#include <bits/stdc++.h>
using namespace std;

#define FREP(i,a,b) for(long long i=a;i<b;i++)
#define REP(i,n) FREP(i,0,n)
#define PB push_back
#define ll long long
#define MP make_pair
#define mod 1000000007
#define endl "\n"
#define vi vector<ll>
#define si set<ll>
#define mi map<ll,ll>
#define bs binary_search
#define pri(a,n) REP(i,n)cout<<a[i]<<" ";
#define all(x) x.begin(),x.end()
#define sz(a) (ll)a.size()
#define sa(a,n) sort(a,a+n)
#define sra(a,n) sort(a,a+n,greater<ll>())
#define sv(v) sort(all(v))
#define srv(v) sort(v.rbegin(),v.rend())
#define sp(x) fixed<<setprecision(x)
#define mem(a) memset(a,-1,sizeof(a))
#define ff first
#define ss second
#define deb(x) cout<<#x<<' '<<x<<endl;
#define FASTIO ios_base::sync_with_stdio(false);\
               cin.tie(NULL);\
               cout.tie(NULL);

void _a_b_c_d_e_f_g_h_i_j_k_l_m_n_o_p_q_r_s_t_u_v_w_x_y_z()
{
    ll n, k, q = 0, c = 0;
    string s;
    cin >> n;
    FREP(i, 1, 10000001)
    if (((2 * n + i - i * i)) % (2 * i) == 0 && 2 * n + i - i * i > 0)
        ++c;
    cout << c * 2;
}

int main()
{
    FASTIO;
    int t = 1;
    // cin >> t;         // Test Case :-||-: //

    while (t--)
    {
        _a_b_c_d_e_f_g_h_i_j_k_l_m_n_o_p_q_r_s_t_u_v_w_x_y_z();
    }

    return 0;
}

// Thanks for stalking :P
#include<bits/stdc++.h>
using namespace std;

using ll=long long;
ll mod=1000000007;

set<ll> enum_divisors(ll N){
   set<ll> res;
   for(ll i=1;i*i<=N;i++){
      if(N%i==0){
         res.insert(i);
         res.insert(N/i);
      }
   }
   return res;
}

int main(){
    ll N,count=0;
    cin >> N;
    const auto &P=enum_divisors(2*N);
    for(auto it=P.begin();it!=P.end();it++){
        if(*it%2==1){
            count+=2;
        }
    }
    cout << count << endl;
}