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

#define watch(x)           cout<<(#x)<<"="<<(x)<<'\n'
#define mset(d,val)         memset(d,val,sizeof(d))
#define setp(x)             cout<<fixed<<setprecision(x)
#define loop(i,a,b)         for(int i=(a);i<(b);i++)
#define hunt(i,a,b)         for(int i=(a);i<=(b);i++)
#define lp(i,a,b)           for(int i = a; i >= b; i--)
#define rep(i,n)            for(int i = 0; i < n; i++)
#define int                 long long int 
#define boost    ios_base::sync_with_stdio(false); cin.tie(NULL);
#define pb                  push_back
#define f                   first
#define s                   second
#define pqueue              priority_queue
#define fbo                 find_by_order
#define ook                 order_of_key
#define ll                  long long
#define ii                  pair<ll,ll>
#define vi                  vector<ll>
#define vii                 vector<ii>
#define ld                  long double
#define rd(n)              cin >> n  
#define out(n)             cout << n <<endl  
#define all(x)            begin(x),end(x)
void YES(){cout<<"YES\n";} void NO(){cout<<"NO\n";}
ll Bexp(ll a,int b){ ll ret=1; for (;b;a=a*a,b>>=1) if (b&1) ret=ret*a; return ret; }
ll gcd(ll A , ll B)
{
	if(B == 0)return A;
	return gcd(B , A%B);
}
ll min(ll a , ll b){return a > b ? b : a;}
ll max(ll a , ll b){return a > b ? a : b;}
#define MOD 1000000007




// count of required AP
int CountArithmaticProgressions(int sum, int d)
{
    // store the 2*sum in another variable
    int S = 2 * sum;

    // Declare the answer variable
    int answer = 0;

    // Iterate over the factors

    for (int i = 1; i <= sqrt(S); i++) {
        // Check if i is a factor or not
        if (S % i == 0) {

            if (((S / i) - d * i + d) % 2 == 0)
                answer++;

            if ((d * i - (S / i)  + d) % 2 == 0)
                answer++;
        }
    }

    // Return the answer
    return answer;
}


signed main()
{
   boost

   #ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
   #endif

	int n = 1 , N;

	rd(N);

	int sum  = 2*N;

	/*
       n*(n+2*a-1) = 2*N
         a = (2*N/i - i + 1)/2
         n is a factor of 2*N
         also (2*N/n) is also a factor of 2*N

         2*N/2*N/i   - 2*N/i + 1

         i - 2*N/i + 1.

 	 */

	// check for the factors .. 

	out(CountArithmaticProgressions(N , 1));

}

#include<bits/stdc++.h>
#define re register
using namespace std;
#define int long long
inline int read(){
	re int t=0;re char v=getchar();
	while(v<'0')v=getchar();
	while(v>='0')t=(t<<3)+(t<<1)+v-48,v=getchar();
	return t;
}
int a,b,c;
signed main(){
	a=read()*2;
	for(re int i=1;i<=sqrt(a);++i){
		if(a%i==0&&((i&1)!=((a/i)&1)))b+=2;
	}
	printf("%lld",b);
}
