#include<bits/stdc++.h>
#define LL long long
#define ULL unsigned long long
#define pro r /= i,++sum
using namespace std;
inline LL read()
{
LL x=0,f=1;
char ch = getchar();
while(!isdigit(ch)) {if(ch == '-') f = -1;ch = getchar();}
while(isdigit(ch)) {x=x*10+ch-48;ch=getchar();}
return f*x;
}
int main(int argc,char *argv[])
{
LL r = read(),ans = 1,sum;
for(int i = 2;i <= sqrt(r);++i)
if(!r%i)
{
sum = 0;
pro;
while(!r%i) pro;
if(!(i%4-1)) ans *= (sum/2)|1;
}
if((r-1) && !(r%4-1)) ans *= 3;
printf("%lld\n",ans<<2);
#ifndef ONLINE_JUDGE
printf("Time used = %.0lfms\n",((double)clock()/(double)CLOCKS_PER_SEC) * 1000.0);
#endif
return 0;exit(0);
}