N = int(input()) ans = 0 if N==0:exit(print(0)) for x in range(1,N+1): if (N**2-x**2)**0.5%1==0 and int((N**2-x**2)**0.5)>0:ans+=1 print(ans)