#include <bits/stdc++.h>
using namespace std;
#define ll long long
const ll mod=1e9+7;
const ll INF=4e18;
const int inf=1e9;
const double pi=acos(-1);
ll n, ans;

ll cek(ll pos, ll pjg){
	return pjg*(2*pos+(pjg-1))/2;
}

int main() {
	ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	cin >> n;
	for(int len=1;len<=2000000;++len){
		ll l=1, r=n;
		while(l<=r){
			ll mid=(l+r)/2;
			ll cur=cek(mid, len);
			if(cur==n){
				ans+=2;
				break;
			}
			else if(cur>n){
				r=mid-1;
			}
			else l=mid+1;
		}
	}
	cout << ans << '\n';
}
// #pragma GCC optimize("Ofast,unroll-loops")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,mmx,avx,avx2")
#include "bits/stdc++.h"

#define     ll                long long
#define     ul                unsigned long long
#define     ld                long double
#define     rep(i, a, b)      for(int i=(a); i<(b); i++)
#define     repi(i, a, b)     for(int i=(a); i>(b); i--)
#define     all(x)            x.begin(), x.end()
#define     rall(x)           x.rbegin(), x.rend()
#define     db(x)             (cout<<#x<<":"<<(x)<<'\n')
#define     fastio            ios_base::sync_with_stdio(false), cin.tie(nullptr)
#define     gcd               _gcd
#define     lcm(a,b)          __detail::__lcm(a,b)
#define     goog(tno)         cout << "Case #" << tno <<": "
#define     pb                push_back
#define     endl              "\n"
#define     iceil(n, x)       (((n) + (x) - 1) / (x))

const ll mod = 1000000007;
const ld pi = 3.1415926535897932384626433832795;
const ll INF = 1e18;

using namespace std;

void solve()
{
	ll n;
	cin >> n;
	ll cnt = 0;
	for (ll i = 1; (i * (i - 1)) / 2 < n; i++)
	{
		ll start = (n - ((i * (i - 1)) / 2)) / i;
		if ((start * i + (i * (i - 1)) / 2) == n)
			cnt++;

	}
	cout << cnt * 2 << endl;
}

int main() {
	fastio;
	int tz = 1;
	//cin >> tz;
	while (tz--)
	{
		solve();
	}
	return 0;
}