// #pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math")
// #pragma GCC target("avx,avx2,fma")
#include <bits/stdc++.h>
#define f first
#define s second
#define fore(i,a,b) for(int i = (a), ThxMK = (b); i < ThxMK; ++i)
#define pb push_back
#define all(s) begin(s), end(s)
#define _ ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define sz(s) int(s.size())
#define ENDL '\n'
using namespace std;
typedef long double ld;
typedef long long lli;
typedef pair<lli,lli> ii;
typedef vector<lli> vi;
#define deb(x) cout << #x": " << (x) << endl;


int main(){ _
  lli n; cin >> n;
  if(n == 1) {
    cout << 2 << ENDL;
    return 0;
  }
  lli ans = 0;
  lli cur = 0;
  fore(i, 1, 1e8) {
     cur += i;
     if(cur > n) break;
     lli x = n - cur;
     if(x % i == 0) ++ans;
  }
  cout << ans * 2LL << ENDL;
  return 0;
}

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<int, int> PII;

bool ok (ll len, ll tot)
{
	ll tmp = tot / len;
	return (tmp + 1 - len) % 2 == 0;
}

int main()
{
	ll n; scanf("%lld", &n);
	
	n <<= 1;
	int cnt = 0;
	for (ll i = 1; i * i <= n; i++)
	{
		if (n % i) continue;
		cnt += ok(i, n);
		if (i * i != n) cnt += ok(n / i, n);
	}
	printf("%d\n", cnt);
	
	return 0;
}