#include<iostream>
#include<cstdlib>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
using namespace std;
int n;
int h[20020];
long long b;
long long num=0;
bool Comp(int a,int b)
{
return a>b;
}
int main()
{
freopen("squares.in","r",stdin);
freopen("squares.out","w",stdout);
int n;
scanf("%d",&n);
int ans=0;
for(int i=1;i<=500;i++)
{
for(int j=1;j<=500;j++)
{
if(i*i-j*j==n)
{
ans++;
}
}
}
cout<<ans;
return 0;
}