ll n,z;{rd(n);n*=n;REP(a,1,800)REP(b,a,n%a?0:5d4)z+=(Isqrt_s((a+b)**2+4n/a/b)>=a+3b)>n/a%b;wt(z);}