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