#include <bits/stdc++.h>

using namespace std;
using ll = long long;

int cnt;
ll n;
unordered_set<ll> factor;

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

    for (int i = 1; (ll)i * i <= 2 * n; ++i)
    {
        if (2 * n % i == 0)
        {
            factor.insert(i);
            factor.insert(2 * n / i);
        }
    }

    for (auto item: factor)
        cnt += (((2 * n / item) - item + 1) % 2 == 0);

    cout << cnt;
}
#include <bits/stdc++.h>
#define int long long 
using namespace std;

int n;
vector<int> a;
int k;
vector<pair<int, int>> c;
int m;
int maxi = 0;
void f(vector<int> a, vector<pair<int, int>> v, int k) {
	if(k == 0) {
		int cc = 0;
		// for(auto e: a) cout << e << ' ';
		// cout << endl;
		for(int i = 0; i < m; i++) {
			// cout << c[i].first << c[i].second << endl;
			if((a[c[i].first] > 0) and (a[c[i].second] > 0)) {
				cc++;
			}
		}
		// cout << cc << endl;
		maxi = max(maxi, cc);
		return;
	}
	// cout << v[k].first << ' ' << v[k].second << endl;
	a[v[k].first] += 1;
	f(a, v, k - 1);
	a[v[k].first] -= 1;
	a[v[k].second] += 1;
	f(a, v, k - 1);
	a[v[k].second] -= 1;
}


int32_t main() {
    #ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif
    int t;
    t = 1;
    while(t--) {
    	int n;
    	cin >> n;
    	// si - sx = n
    	// si - n = sx
    	// 
    	// i*(i+1) - 2n = x(x+1)
    	//2n + x*(x+1) = (i * (i + 1))
    	// 2n + x2 + x = i2+i
    	// 2n = i2 - x2 + i - x
    	// 2n = (i-x)(i + x + 1)
    	// 2n = l(l + 2x + 1)
    	// 
    	int ans = 0;
    	for(int l = 1; l * (l + 1) <= 2 * n; l++) {
    		if((2 * n) % l) continue;
    		int y = (2 * n);
    		y /= l;
    		int z = y - l - 1;
    		if(z % 2 == 0) ans += 2;
    	}
    	cout << ans;
    	return 0;
    }

    

    return 0; 
}