#include #include #include using namespace std; int get1Nums(int n) { char S[100]; memset(S,'\0',100); sprintf(S,"%x",n); int num=0; char *p=S; while (*p!='\0'){ switch(*p){ case '1'://0001 case '2'://0010 case '4'://0100 case '8'://1000 num+=1; break; case '3'://0011 case '5'://0101 case '6'://0110 case '9'://1001 case 'a'://1010 case 'c'://1100 num+=2; break; case '7'://0111 case 'b'://1011 case 'd'://1101 case 'e'://1110 num+=3; break; case 'f': num+=4; break; } p++; } return num; } int main(int argc, char* argv[]) { int N; cin>>N; vector A(N+1); vector flag(N+1); for (int i=1;i<=N;i++){ A[i]=get1Nums(i); } int index=A[1]; if (index==N){ cout<<0<