#include<stdio.h>
#include<math.h>

int main()
{
    int n, temp,remainder,digits = 0;
    double sum = 0;
    
    scanf("%d",&n);
    
    if(n < 0){
        priintf("Invalid Input\n");
        return 0;
    }
    
    temp = n;
    
    while(temp != 0){
        remainder = temp % 10;
        sum += pow(remainder,digits);
        temp /= 10;
    }
    
    if((int)sum == n)
      printf("Armstrong\n");
    else
      printf("Not Armstrong\n");
    
    
    return 0;
}