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