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