from math import isqrt N = int(input()) c = 0 for x in range(1, N): if isqrt(N * N - x * x) ** 2 == N * N - x * x: c += 1 print(c)