#include <iostream>
#include <cmath>
using namespace std;

int main(int argc, char* argv[]) {
    if (argc != 2) {
        cout << "Invalid input" << endl;
        return 1;
    }

    int n = atoi(argv[1]);
    if (n < 0) {
        cout << "Invalid input" << endl;
        return 1;
    }

    int original = n, sum = 0, digits = 0;

    // Count digits
    int temp = n;
    while (temp != 0) {
        digits++;
        temp /= 10;
    }

    // Calculate Armstrong sum
    temp = n;
    while (temp != 0) {
        int digit = temp % 10;
        sum += pow(digit, digits);
        temp /= 10;
    }

    if (sum == original)
        cout << "True" << endl;
    else
        cout << "False" << endl;

    return 0;
}