#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()
using ll = long long;
const ll mod = 1000000007;
const double pi = 3.14159265358979;
const ll INF = 1e18;

vector<ll> divisor(ll n) {
    vector<ll> ret;
    for (ll i = 1; i * i <= n; i++) {
        if (n % i == 0) {
           ret.push_back(i);
           if (i * i != n) ret.push_back(n / i);
        }
    }
    sort(ret.begin(), ret.end());
    return ret;
}

int main() {
    ll n; cin >> n;
    vector<ll> div = divisor(2 * n);
    ll ans = 0;
    for (ll m : div) {
        if ((2 * n / m - m + 1) % 2 == 0) ans++;
    }
    if (n == 1) cout << 2 << endl;
    else cout << ans << endl;
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define deb(x)cout << #x << " = " << x << " , " << '\n';
#define mod 100000000


int main(){
	ll s, ans = 0;
	cin >> s;
	s *= 2;
	for(ll i=1; i*i<=s; i++){
		if(s%i==0){
			ll tmp = (s/i) - (i-1);
			if(tmp%2==0)ans++;
			if(i!=(s/i)){
				ll tmp = (s/(s/i)) - (s/i) - 1;
				if(tmp%2==0)ans++;
			}
		}
	}
	cout << ans;
	return 0;
}