#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>
#include <cmath>
#include <functional>
#include <utility>
#include <tuple>
#include <numeric>
#include <queue>
#include <cstring>
#include <sstream>
#include <iomanip>
#include <regex>
#include <stack>
#include <limits>
#include <climits>

using namespace std;

int main() {
	ios_base::sync_with_stdio(false);
	long long n;
	cin >> n;
	n *= 2;
	int res = 0;
	for (long long i = 1; i*i < n; ++i) {
		if (n % i == 0) {
			long long d = i;
			if ((n / d - d + 1) % 2 == 0) ++res;
			d = n / i;
			if ((n / d - d + 1) % 2 == 0) ++res;
		}
	} 
	cout << res << endl;
	return 0;
}

#include<bits/stdc++.h>
#define Pair pair<ll,int>
#define ar array
#define ll long long
#define ull unsigned long long 
#define pb push_back

using namespace std ;
const ll LLMAX = 9223372036854775807;



int main(){
    ll n;
    cin>>n;
    ll cur_low = n;
    ll num_len = 1;
    ll sum = n;
    ll res = 0;
    while(cur_low>0){
        if((sum-n)%num_len==0){
            ll diff = (sum-n)/num_len;
            if(diff<0)
                break;
            res++;
            cur_low-=diff;
            sum = n+cur_low-1;
            //cout<<"cur low "<<cur_low<<endl;
            //cout<<"num len "<<num_len<<endl;
            cur_low--;
            num_len++;
        }
        else{
            cur_low--;
            sum+=cur_low;
            num_len++;
        }
    }
    /*
    res = 1+res*2;
    ll s = sqrt(1+8*n);
    if(s*s == 1+8*n){
        if((-1+s)%2==0)
            res++;
    }
    */
    cout<<2*res<<endl;
}
