#include<stdio.h>
#include<math.h>
int main(){
    int n,o,re,,ru=0,d=0'
    scanf("%d",&n);
    if(n<0){
        printf("Invalid Input");
        return 0;
    }
    o=n;
    int temp =n;;
    while (temp !=0){
        d++;
        temp /= 10;
    }
    temp  = n;
    while(temp !=0){
        re = temp%10;
        ru += pow(re,d);
        remp /= 10;
    }
    if(ru==0){
        printf("Armstrong");
    }
    else
    {
        printf("Not Armstrong");
    }
    return 0;
}