import java.util.*;
class main
{
    public static void main(String[] args) 
     {
         Scanner s=new Scanner (System.in);
    //     int n=s.nextInt();hougtrjyytytutyujhfyurhb   vng
    //     char ch='A';
    //     int a=1
    //     for (int i= 1;i<=n;i++){
    //         for (int j=1;j<=n-i;j++){
    //             System.out.print(" ")
            
            
        //   int n =s.nextInt();
        //   for (int i= 1;i<=n;i++){
        //       for (int j=1;j<=n;j++){
                   
        //             System.out.print(j+" ");
        //       }
        //       System.out.println();
        //   }
        
        // int n =s.nextInt();
        // int count=0;
        // for (int i= 1;i<=n;i++){
        //     if (n%i==0){
        //         count++;
        //     }
        // }
        // if(count==2){
        //       System.out.println(n+" is an prime number " );
        // }else{
        //       System.out.println(n+" is not an prime number ");
        // }
        
        
         int n =s.nextInt();
         int temp=n;
         int count=0;
         while(temp>0){
             count++;
             temp=temp/10;
             }
             temp=n;
             int sum=0;
             while(temp>0){
                 int last=temp%10;
                 sum+=Math.pow(last,count);
                 temp=temp/10;
             }
             if(sum==n){
                 System.out.println(n+" is an Armstrong Number ");
             }else{
                 System.out.println(n+" is not an Armstrong Number ");
                 
             }
         }
    }