n = int(input()) ans = 0 for i in range(1,n): if (n**2-i**2)**0.5 % 1 == 0: ans += 1 print(ans)