//#pragma GCC optimize ("O2")
//#pragma GCC target ("avx2")
#include<bits/stdc++.h>
//#include<atcoder/all>
//using namespace atcoder;

using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define Would
#define you
#define please

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);


	ll N;
	cin >> N;

	int kotae = 0;
	rep1(i, 3000000) {
		if (N % i == 0) {
			ll a = i;
			ll b = N / i;
			if (a > b) break;
			if (a % 2 == 1) kotae++;
			if (a != b) {
				if (b % 2 == 1) kotae++;
			}
		}
	}
	rep1(i, 3000000) {
		if (2 * N % i == 0) {
			ll a = i;
			ll b = 2 * N / i;
			if (a > b) break;
			if (a % 2) {
				kotae++;
			}
			if (a != b) {
				if (b % 2) kotae++;
			}



		}
	}
	co(kotae);

	Would you please return 0;
}
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll gcd(ll a,ll b)
{
    return b?gcd(b,a%b):a;
}
ll a[100005],b[100005],c[1005],d[1005],v[1005],vv[1005];
int main()
{
    ll n,m,k,i,j,flag=0,ansx=0,ansy=0,t,sum1,sum,s,ma,ans,q=0;
    a[1]=a[2]=2;
    a[3]=4;
    ans=0;
    scanf("%lld",&n);
    n*=2;
    for(i=1;i*i<=n;i++)
    {
        if((i%2==1&&n%i==0)||(n%i==0&&(n/i)%2==1))
        {
            ans++;
        }
    }
    printf("%lld\n\n",ans*2);


    return  0;

}
