#include <bits/stdc++.h>
using namespace std;
#define ll long long
const ll mod=1e9+7;
const ll INF=4e18;
const int inf=1e9;
const double pi=acos(-1);
ll n, ans;

ll cek(ll pos, ll pjg){
	return pjg*(2*pos+(pjg-1))/2;
}

int main() {
	ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	cin >> n;
	for(int len=1;len<=2000000;++len){
		ll l=1, r=n;
		while(l<=r){
			ll mid=(l+r)/2;
			ll cur=cek(mid, len);
			if(cur==n){
				ans+=2;
				break;
			}
			else if(cur>n){
				r=mid-1;
			}
			else l=mid+1;
		}
	}
	cout << ans << '\n';
}
/******************************************
* AUTHOR : RTG *
******************************************/
#include <bits/stdc++.h>
using namespace std;

// long long dp[(long long)1e12+1];

int main() {

	ios_base::sync_with_stdio(false);
	cin.tie(NULL);

	#ifndef ONLINE_JUDGE 
    // For getting input from input.txt file 
    FILE *input = freopen("/home/tharun/Documents/cpg/input.txt", "r", stdin); 
    // Printing the Output to output.txt file 
    FILE *output = freopen("/home/tharun/Documents/cpg/output.txt", "w", stdout); 
    int start_time = (int)clock();
    #endif 

    long long n;
    cin>>n;
    n*=2;
    long long ans=0;
    for(long long i=1;i*i<=n;i++){
    	if(n%i==0){
    		long long d1=i;
    		long long d2=n/i;

    		if((d2-d1+1)%2==0){
    			ans++;
    		}
    	}
    }
    cout<<2*ans;

    #ifndef ONLINE_JUDGE 
    // Time taken for execution
    cout<<"\nTime = "<<clock() - start_time<<"ms";
    #endif 
    
	return 0;
}