heiho = set([i ** 2 for i in range(1, 200010)]) n = int(input()) ans = 0 for i in range(1, 200010): if n ** 2 - i ** 2 in heiho: ans += 1 print(ans)