#include <stdio.h>
#include <math.h>

int main(int argc, char *argv[]) {
    if (argc != 2) return 1;
    int n = atoi(argv[1]);
    if (n < 0) {
        printf("Invalid input\n");
        return 0;
    }
    int sum = 0, temp = n, digits = 0;
    while (temp) {
        digits++;
        temp /= 10;
    }
    temp = n;
    while (temp) {
        sum += pow(temp % 10, digits);
        temp /= 10;
    }
    printf("%s\n", sum == n ? "True" : "False");
    return 0;
}