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