#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i, N) for(int i = 0; i < (int)N; i++)
#define CREP(i, l, r) for(int i = l; i <= r; i++)
const ll LLINF = (1LL << 60);   // > 10^18 ll  2*LLINF

int main() {
    ll n;
    cin >> n;

    vector<ll> sum(5000010, 0);
    REP(i,5000000) sum[i+1] += sum[i]+i+1;

    ll res = 2;
    for(int k = 2; n >= sum[k]; k++){
        if(n%k == sum[k-1]%k) res += 2;
    }


    cout << res;
}

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
	ll n;
	cin>>n;
	n*=2;
	int ans=0;
	for(ll l=1;l*l<=n;l++){
		if(n%l==0){
			ll t=n/l+1-l;
			if(t%2==0){
				ans++;
				if(t)ans++;
			}
		}
	}
	cout<<ans;
} 