from math import isqrt n = int(input()) ans = 0 for x in range(1, 2 * 10 ** 5 + 1): m = n ** 2 - x ** 2 if m > 0: y = isqrt(m) if y ** 2 == m: ans += 1 print(ans)