#include <bits/stdc++.h>
#include <functional>
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <cctype>
#include <string>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <stdio.h>
#include <string.h>
using namespace std;
typedef pair<int, int> pii;
#define fast                          \
    ios_base::sync_with_stdio(false); \
    cin.tie(0);                       \
    cout.tie(0)
#define ll long long
#define ld long double
#define rep(i, a) for (ll i = 0; i < a; i++)
#define repe(i, a, b) for (ll i = a; i < b; i++)
#define bac(i, a) for (ll i = a; i >= 0; i--)
#define bace(i, a, b) for (ll i = a; i >= b; i--)
#define pb push_back
#define in insert
#define ff first
#define ss second
#define setbit(x) __builtin_popcountll(x)
#define init(c, a) memset(c, a, sizeof(c))
#define all(c) c.begin(), c.end()
#define sz(c) (ll) c.size()
#define lb lower_bound
#define ub upper_bound
#define maxe *max_element
#define mine *min_element
#define rev reverse
#define endl "\n"
#define debug(x) cout << #x << " : " << x << endl;
const ll inf = 1e18;
const ll mod = 1e9 + 7;
const ll MOD = 998244353;
//priority_queue<pii, vector<pii>, greater<pii> > pq;

ll gcd(ll a, ll b)
{
    if (b == 0)
    {
        return a;
    }
    return gcd(b, a % b);
}

ll n;
bool check(ll N, ll n)
{
    if ((N / n - (n - 1)) % 2 == 0)
        return 1;
    else
        return 0;
}
void solve()
{
    cin >> n;
    n *= 2;
    // 2a+n-1=N/n
    // a = (N/n-(n-1))/2
    ll ans = 0;
    for (ll i = 1; i * i <= n; ++i)
    {
        if (n % i == 0)
        {
            if (n / i != i)
            {
                if (check(n, i))
                    ans++;
                if (check(n, n / i))
                    ans++;
            }
            else
            {
                if (check(n, i))
                    ans++;
            }
        }
    }
    cout << ans << '\n';
}
int main()
{
    fast;
    int t = 1;
    while (t--)
        solve();
    return 0;
}
#include <bits/stdc++.h>
using namespace std;
long long mod=1e9+7;

int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int t=1;
    // cin>>t;
    while(t--){
        long long n;
        cin>>n;
        set <long long> divs;
        for(long long i=1;i*i<=2*n;i++){
            if((2*n)%i==0){
                divs.insert(i);
                divs.insert(-i);
                divs.insert((2*n)/i);
                divs.insert(-(2*n)/i);
            }
        }
        int ans=0;
        for(auto x:divs){
            if(x>0){
                if(((2*n)/x+1-x)%2==0)ans++;
            }
        }
        cout<<ans<<"\n";
    }    
    return 0;
}