import java.util.*;
public class Main {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
//function calling
System.out.println(Armstrong(N));
}
//function declaration
public static boolean Armstrong(int N)
{
int r = 0;
int ans = 0;
int temp = N;
boolean isArmstrong = true;
while(N!=0)
{
r = N%10;
ans = ans + (r * r * r);
N = N/10;
}
if(temp == ans)
{
return isArmstrong;
}
else
{
isArmstrong = false;
return isArmstrong;
}
}
}