import math def main(): N = int(input()) answer = 0 for i in range(1, N): if math.isqrt(N ** 2 - i ** 2) ** 2 == N ** 2 - i ** 2: answer += 1 print(answer) if __name__ == '__main__': main()