#include <iostream>
#include <cmath>
using namespace std;
int main()
{
int n, s = 0;
cin >> n;
while (n > 0)
s += pow(n % 10, 3);
n = n / 10;
}
cout << s;
return 0;
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
int n, s = 0;
cin >> n;
while (n > 0)
{
s += pow(n % 10, 3);
n = n / 10;
}
cout << s;
return 0;
}