{ll n,z;rd(n);n*=n;rep(a,1,800)if(n%a<1)rep(b,a,5d3)if(n/a%b<1)z+=Isqrt_s((a+b)**2+4n/a/b)>=a+b*3;wt(z);}