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