#include<stdio.h>
#include<math.h>
int main(){
    int N;
    if(N<0){
        printf("Invalid input");
        return 0;
    }
    temp=N;
    while (temp !=0){
        digits++;
        temp/=10;
    }
    temp=N;
    while(temp !=0){
        int digit=temp%10;
        sum+=pow(digit,digits);
        temp/=10;
    }
    if(sum==N){
        printf("True");
    }
    else{
        printf("False");
    }
    return 0;
    
}