#include <bits/stdc++.h>
using namespace std;
using P = pair<int, int>;
using ll = long long;
template<typename T> bool chmax(T &a, const T b) {
    if (a < b) {a = b; return true;} else return false; }

template<typename T> bool chmin(T &a, const T b) {
    if (a > b) {a = b; return true;} else return false; }


int main() {
  ll n;
  cin >> n;
  if (n == 1) {
    cout << 2 << endl;
    return 0;
  }
  if (n == 2) {
    cout << 2 << endl;
    return 0;
  }
  ll cnt = 0LL;
  
  for (int m = 1; m < 1500000; m++) {
    if (m*(m+1) <= 2*n) {
      if ((m%2 == 1) && (n%m == 0) && ((n/m)-((m-1)/2) > 0)) {
        cnt += 2LL;
    
      }
      if ((m%2 == 0) && (n%(m/2) == 0) && (n%m == m/2) && (2*n - pow(m, 2) + m > 0)) {
                                                         
        cnt += 2LL;
       
      }
    }
    
  }
  cout << cnt << endl;
  return 0;
  
}
  
  
  
    
  
  
    

 
  
  

   

      
#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
#define inf 1e9
#define linf 1e18
#define BASE 1000000
#define EPS 1e-10
#define PI acos(-1)
#define pii pair<int,int>
#define piii pair<int, pair<int,int>>
#define pli pair<long long, int>
#define pll pair<long long, long long>
#define pdi pair<double,int>
#define vi vector<int>
#define fi first
#define se second
#define ALL(x) (x).begin(), (x).end()
#define ms(x,val_add) memset(x, val_add, sizeof(x))
#define pb(x) push_back(x)
#define make_unique(x) sort(ALL(x)) ; x.erase( unique(ALL(x)), x.end()) ;
#define dbg(x) do { cout << #x << " = " << x << endl; } while(0)
#define mp(x, y) make_pair(x, y)
#define minimize(x, y) x = min(x, y)
#define maximize(x, y) x = max(x, y)


/*** IMPLEMENTATION ***/
bool exitInput = false;
int ntest = 1, itest = 1 ;

const int dx[4] =
{
    -1, 0, 1, 0
};
const int dy[4] =
{
    0, 1, 0, -1
};

const ll Mod = 1000000007LL;
const int maxn = 100000 + 5;
const int maxv = 500 + 5;
const int maxe = 10000 + 5;

void addMod(ll &x, ll y)
{
    x = (x + y) % Mod;
}
ll modPow(ll x, ll p)
{
    if(p == 0)
        return 1;
    ll r = modPow(x, p / 2);
    r = (r * r) % Mod;
    if(p & 1)
        r = (r * x) % Mod;
    return r;
}

int main()
{
    #ifdef HOME
    freopen( "input.txt", "r", stdin );
    freopen( "output.txt", "w", stdout );
    #endif // HOME
    #ifdef HOME // Copied from Um_nik
	#   define eprintf(...) fprintf(stdout, __VA_ARGS__);fflush(stdout);
    #else
        #define eprintf(...) 42
    #endif

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout << setprecision(10);
    cout << fixed;

    //cin >> ntest;
    for(itest = 1; itest <= ntest; ++itest)
    {
        //cout << "Case #" << itest << ": ";
        ll n;
        cin >> n;
        n = 2 * n;
        int cnt = 0;
        for(ll x = 1; x * x <= n; ++x)
        {
            if(n % x == 0)
            {
                ll h = n / x;
                ll a2 = h - x - 1;
                cnt += abs(a2) % 2 == 0;

                if(h != x)
                {
                    a2 = x - h - 1;
                    cnt += abs(a2) % 2 == 0;
                }
            }
        }
        cout << cnt << endl;
    }

    return 0;
}
