#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef vector<ll> vi;
typedef pair<int,int> pi;
typedef vector<pi> pii;
#define all(x) x.begin(),x.end()
#define sz(x) (int)(x).size()
#define pb push_back
#define mk make_pair
#define en '\n'

void solve() {
	ll n,ans = 0;
	cin >> n;

	n *= 2;
	set<ll> factor;
	for (ll i = 1; i*i <= n; ++i)
	{
		// n^2 <= 2n so there will be 2 factors 
		if(n%i == 0){
			factor.insert(i);
			//factor.insert(n/i);
		}
	}
	for(auto x:factor){
		if((n/x+1-x) % 2 == 0) ans++;
	}
	cout << ans*2 << en;
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);

	/*freopen(".in","r",stdin);
	freopen(".out","w",stdout);*/

	int t = 1;
	//cin >> t;
	while(t--) {
		solve();
	}
	return 0;
}	
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define ll long long
#define ff first
#define ss second
ll a,b,c,d=0,e=0,i,f=0,g=0,j,k=0,l=0,r,z,m[101],h[101],p[101],mod=1000000007,mod1=998244353;
string t,x,q,s;
ll df[201];
//double ;
vector<ll>v;
vector<ll>u,w;
vector<ll>dv[201];
//vector<string>;
set<string>y;
pair<ll,ll>n[17];
void dfs(ll x){
    for(ll i=0;i<dv[x].size();i++){
        if(df[dv[x][i]]==0){
            df[dv[x][i]]=df[x];
            dfs(dv[x][i]);
        }
    }
}
ll fastPow(ll a,ll b){
    ll d=1;
    while(b>0){
        if(b%2==1){
            d=d*a%mod;
        }
        b/=2;
        a=a*a%mod;
    }
    return d;
}
int main(){
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    cin>>a;
    for(i=1;i<=sqrt(a);i++){
        if(i*i==a){
            v.pb(i);
            continue;
        }
        if(a%i==0){
            v.pb(i);
            v.pb(a/i);
        }
    }
    d=0;
    for(i=0;i<v.size();i++){
        if(v[i]%2==1){
            d+=2;
        }
    }
    cout<<d;
}