#include using namespace std; using ll = long long; int main(){ int n; cin >> n; int ans = 0; for(int i = 1; i*i <= n; i++){ int ret = 0; if(n%i==0){ ret = 1; int a = i; int b = n/i; for(int j = 30; j >= 0; j--){ int A = (a>>j)&1; int B = (b>>j)&1; if(A==0 && B==0) ret *= 1; if(A==0 && B==1) ret *= 1; if(A==1 && B==0) ret *= 0; if(A==1 && B==1) ret *= 2; } } ans += ret; } ans /= 2; cout << ans << endl; return 0; }