#include<bits/stdc++.h>
using namespace std;
#define mp make_pair 
#define fi first
#define se second
#define pb push_back
#define pf push_front
#define pob pop_back
#define pof pop_front

typedef long long ll;
typedef unsigned long long ull;
typedef short int si;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

const int nMax = 1e6+5;
const ll mod = 1e9+7;

ll n,sum;

ll hitung(ll x, ll y) {
	ll ans = 0;
	if (y & 1) 
		ans = ((y+1) / 2) * y;
	else 
		ans = (y / 2) * (y + 1);

	x--;
	if (x & 1) 
		ans -= ((x+1) / 2) * x;
	else 
		ans -= (x / 2) * (x + 1);

	return ans;
}
bool binser(ll num) {
	ll l = 1, r = n/num + 1;
	while(l <= r) {
		ll mid = (l+r)/2;
		ll total = hitung(mid,mid+num-1);

		if (total == n)
			return 1;
		else if (total > n)
			r = mid-1;
		else
			l = mid+1;
	}
	return 0;
}
int main(){
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

	cin >> n;
	sum = 0;
	for (ll i=1;i<=1e7;i++) {
		if (binser(i)) {
			sum += 2;
		}
	}
	cout << sum << "\n";
	return 0;

}
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;


int main() {
  long long n;
  cin >> n;
  long long ans = 0;
  for(long long i = 1; i * i < n*2+1; i++){
    if (n % i == 0){
      if (i % 2 == 1) ans++;
    }
    if (2 * n % i == 0)
      if (n % i != 0)
        ans++;
  }
  cout << ans * 2 << endl;
}