#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define mod 1000000007
#define F first
#define S second
#define all(v) (v).begin(),(v).end()
#define np next_permutation
#define lp(i,n) for(int i=0;i<n;i++)
#define lps(i,j,n) for(int i=j;i<n;i++)
#define vii vector<vi>
#define vb vector<bool>
#define pr pair<int,int>
#define vl vector<ll>
#define vs vector<string>
#define us unordered_map<int,int>
#define Mpq priority_queue<int>
#define mpq priority_queue<int,vi,greater<int>> 
#define eb emplace_back
#define pr pair<int,int>
#define prl pair<ll,ll>
#define vp vector<pr>
#define vpl vector<prl>
#define mkp make_pair
#define ld long double
#define vii vector<vi>
#define Max(a,b) a=max(a,b)
#define Min(a,b) a=min(a,b)
#define ull unsigned long long
#define prr pair<ll,int>
using namespace std;
using vi=vector<int>;
// #include "Bigint.hpp"


const int N=1e6+11;



void solve(){
	ll n, cnt=0;
	cin >> n;
    // if(n==1){
    // 	cout << 2 << '\n';
    // 	return;
    // }
	for(ll i=1;i<(ll)2e6;i++){
		ll diff = n - i*(i-1)/2;
		if(diff<0LL) break;
		if(!diff or diff % i) continue;
		cnt++;
	}
	cout << 2*cnt << '\n';
}

int main(){
	// #ifndef ONLINE_JUDGE
	//  // for getting input from input.txt
	//  freopen("test3", "r", stdin);
	//  // for writing output to output.txt
	//  // freopen("output4.txt", "w", stdout);
	// #endif


	ios_base::sync_with_stdio(0);  
	cin.tie(nullptr);
	
	int t=1;
	while(t--)
	solve();
}



/*


n*(n+1)/2 - x = N


-6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 5

1 2 3 4 5 
sum(a0+(n-1)d) = n*a0 + n(n-1)/2 * d = (n/2) * (2*a0 + (n-1)d)

n*a0 + n*(n-1)d
an = a0 + (n-1)d

sn = (n/2)*(2*a0 + (n-1)*d)

*/
#include<iostream>

using namespace std;

typedef long long ll;

ll n;

int main(){
	
	cin >> n;
	
	ll l = 1,r = 1e10;
	while(l < r){
		ll mid = l + r + 1 >> 1;
		if((1 + mid) * mid / 2 > n + 1){
			r = mid - 1;
		}else if((1 + mid) * mid / 2 == n + 1){
			l = mid;
			break;
		}else{
			l = mid;
		}
	}
	
	cout << n - l + 1 << endl;
	
	return 0;
}