#include<bits/stdc++.h>
#define ll             long long int
#define vll            vector<ll>
#define mod            1e9+7
#define endl            "\n"
#define fast           ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define pb             push_back
#define inp(V,n)      for(int i=0;i<n;i++){cin >> V[i];}
#define all(v)         v.begin(),v.end()
#define allr(v)        v.rbegin(),v.rend()
#define sz             size()
#define oup(v,n)     {for(int i=0;i<n;i++){cout <<  v[i] << " "  ;} cout << endl;
using namespace std;
int main()
{
int t=1;
//cin>>t;
while(t--)
{  ll n,m,i;
   cin>>n;
   ll ans;
    vll v;
     for(i=1;i*i<=2*n;i++)
     { if(2*n%i==0)
         {  v.pb(i);
            ans=2*n/i;
            if(i==ans)
                continue;
                else v.pb((2*n)/i);

         }
     }

     ll cnt=0;
    for(i=0;i<v.size();i++)
    {
          ans=(2*n)/v[i];
        ll chk=v[i]-1;
         if((ans-chk)%2==0)
             cnt++;
         else continue;

    }
    cout<<cnt<<endl;


}
return 0;
}

#pragma GCC optimize("Ofast")
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <iomanip> // setprecision
#include <complex> // complex
#include <math.h> 
#include <cmath>
#include <functional>
#include <cassert>
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
constexpr ll INF = 1e18;
constexpr int inf = 1e9;
constexpr ll mod = 1000000007;
// constexpr ll mod = 998244353;
const int dx[8] = {1, 0, -1, 0,1,1,-1,-1};
const int dy[8] = {0, 1, 0, -1,1,-1,1,-1};
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const char eol = '\n';
// --------------------------------------------------------------------------


int main(){
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  ll N;
  cin >> N;
  N *= 2;
  int ans = 0;
  for(ll i=1; i*i<=N; i++){
    if(N%i == 0){
      ll A = N/i;
      ll B = i;
      if(A > B) swap(A,B);
      // A < B
      if((A+B-1)%2) continue;
      if((B-A-1)%2) continue;
      ll X = (A+B-1)/2;
      ll Y = (B-A-1)/2;
      if(X>Y && X>0 && Y>=0){
        ans += 2;
      }
    }
  }
  cout << ans << eol;
  return 0;
}