from math import isqrt n=int(input()) ans=0 for i in range(1,n): if isqrt(n**2-i**2)**2 == n**2-i**2: ans+=1 print(ans)