#include using namespace std; using ll=long long; using ull=unsigned long long; #define rep(i,n) for(int i=0; i<(n); i++) int N; int two_to_popcount(int x){ int res=1; rep(d,30) res*=((x>>d)&1)+1; return res; } int main(){ cin>>N; int ans=0; for(int i=1; i*i<=N; i++){ int AxorB = i, AorB = N/i; if(AxorB*AorB!=N) continue; if((AorB&AxorB) == AxorB) ans+=two_to_popcount(AxorB)/2; } cout<