#include<stdio.h>
#include<math.h>
int countDigits(int n)
{
    int count=0;
    while(n!=0)
    {
        n/=10;
        ++count;
    }
    return count;
}
int isArmstrong(int n)
{
    int digits=countDigits(n);
    int temp, remainder,sum=0;
    temp=n;
    while(temp!=0)
    {
        remainder=temp%10;
        sum+=pow(remainder,digits);
        temp/=10;
    }
    if(sum==n)
    {
        return 1;
    }
    else{
        return 0;
    }
}