#include<stdio.h>
#include<math.h>
{
    int n,temp,sum=0;
    int digits=0;
    scanf("%d",&n);
    if(n<=0)
    {
        printf("Invalid input");
        return 0;
    }
    temp=n;
    while(temp)
    {
        digits++;
        temp/=10;
    }
    temp=n;
    while(temp)
    {
        sum+=pow(temp%10,digits);
        temp/=10;
    }
    printf(sum==n?"True":"False");
    return 0;
}