#include using namespace std; int N; long ans; long calc(int x) { int T=N/x; if(~T&x)return 0; return 1<<__builtin_popcount(x)-1; } main() { cin>>N; for(int i=1;i*i<=N;i++)if(N%i==0) { ans+=calc(i); if(i