#include <bits/stdc++.h>
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<=(ll)(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=(ll)(b);i--)
#define ALL(x) (x).begin(),(x).end()
#define RALL(x) (x).rbegin(),(x).rend()
#define SIZE(x) ((ll)(x).size())
#define MAX(x) *max_element(ALL(x))
#define MIN(x) *min_element(ALL(x))
using namespace std;
typedef long long ll;
const int INF = 1000000000;

vector<ll> res;

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

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

    enum_divisors(2*N);


    int ans = 0;
    REP(i, SIZE(res)){
        if(res[i]%2 == 1){
            if(N%res[i] == 0){
                ans++;
            }
        }
        else {
            if((N%res[i])*2 == res[i]) ans++;
        }
    }

    cout << ans << endl;

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