#include <stdio.h>
#include <math.h>
int main()
{
    int n;
    sacnf("%d",&n);
    if(n<0)
    {
        printf("Invalid Input");
    }
    else
    {
        int orginalum=n;
        int numdigits=0;
        if(temp==0)
        {
            numdigits=1;
        }
        else
        {
            while(temp>0)
            {
                temp/=10;
                numdigits++;
            }
        }
        int sumofpower=0;
        temp=n;
        while(temp>0)
        {
            int digit=temp%10;
            sumofpower+=pow(digit,numdigits);
            temp/=10;
        }
        if(sumofpower==orginalum)
        {
            printf("Armstrong\n");
        }
        else
        {
            printf("Not Armstrong\n");
        }
    }
    RETURN 0;
}