#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <cmath>
using namespace std;
using ll=long long;
using ld=long double;

ld judge(string s){
  ll res=0;
  vector<ll> v(9);
  for(ll i=0;i<s.length();i++){
    v[s[i]-48-1]++;
  }
  for(ll i=1;i<=9;i++){
    res+=(i*pow(10,v[i-1]));
  }
          return res;
}

int main(){
  ll N;cin>>N;ll res=0;
  N*=2;
  for(ll i=1;i<=sqrt(N);i++){
    if(N%i==0){
      if(i%2==0){
        if((N/i)%2==1)res++;
      }else{
        if((N/i)%2==0)res++;
      }
    }
  }cout<<res*2<<endl;
}
#include <bits/stdc++.h>
using namespace std;

#define all(v) v.begin(), v.end()
#define ll long long
#define rep(i, n) for (ll i = 0; i < n; ++i)
#define rep_up(i, a, b) for (ll i = a; i < b; ++i)
#define rep_down(i, a, b) for (ll i = a; i > b; --i)

#define P pair<ll, ll>
#define Graph vector<vector<ll>>
#define fi first
#define se second

#define vvvvll vector<vector<vector<vector<ll>>>>
#define vvvll vector<vector<vector<ll>>>
#define vvll vector<vector<ll>>
#define vll vector<ll>

#define vvvvdo vector<vector<vector<vector<double>>>>
#define vvvdo vector<vector<vector<double>>>
#define vvdo vector<vector<double>>
#define vdo vector<double>

#define pqll priority_queue<ll>
#define pqllg priority_queue<ll, vector<ll>, greater<ll>>

constexpr ll INF = (1ll << 60);
// constexpr ll mod = 998244353;
// constexpr ll mod = 67280421310721;
constexpr ll mod = 1000000007;
constexpr double pi = 3.14159265358979323846;
template <typename T>
inline bool chmax(T &a, T b) {
    if (a < b) {
        a = b;
        return 1;
    }
    return 0;
}
template <typename T>
inline bool chmin(T &a, T b) {
    if (a > b) {
        a = b;
        return 1;
    }
    return 0;
}
template <typename T>
void pt_vll(vector<T> &v) {
    ll vs = v.size();
    rep(i, vs) {
        cout << v[i];
        if (i == vs - 1)
            cout << "\n";
        else
            cout << " ";
    }
}
template <typename T>
void pt_vvll(vector<vector<T>> &v) {
    ll vs = v.size();
    rep(i, vs) pt_vll(v[i]);
}
template <typename T>
void pt(T val) {
    cout << val << "\n";
}

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

ll modinv(ll a, ll m) {
    ll b = m, u = 1, v = 0;
    while (b) {
        ll t = a / b;
        a -= t * b;
        swap(a, b);
        u -= t * v;
        swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}

void pre_process(vector<vector<ll>> const &a, vector<vector<ll>> &S) {
    ll H = (ll)a.size();
    ll W = (ll)a[0].size();
    S.assign(H + 1, vector<ll>(W + 1));
    for (ll h = 1; h < H + 1; h++) {
        for (ll w = 1; w < W + 1; w++) {
            S[h][w] =
                a[h - 1][w - 1] + S[h][w - 1] + S[h - 1][w] - S[h - 1][w - 1];
        }
    }
}

vector<ll> divisor(ll n, vll &ret) {
    for (ll i = 1; i * i <= n; i++) {
        if (n % i == 0) {
            ret.push_back(i);
            if (i * i != n) ret.push_back(n / i);
        }
    }
    return ret;
}
int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    ll N;
    cin >> N;
    vll ret;
    divisor(2 * N, ret);

    ll ans = 0;
    rep(i, ret.size()) {
        ll x = ret[i];
        ll y = 2 * N / x;

        if ((x - y + 1) % 2 == 0 && (x + y - 1) % 2 == 0) ans++;
    }

    pt(ans);

    return 0;
}