#include<stdio.h>
#include<math.h>
int isArmstrong(int n)
{
    int temp = n, sum=0; digits = 0;
    while (temp>0)
    {
        digits++;
        temp/=10;
    }
    temp=n;
    int digit;
    while (temp>0)
    {
        int 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;
}