import sys import math input = lambda: sys.stdin.readline().rstrip() # ----------------------- # n = int(input()) ans = 0 for x in range(1, 200001): y2 = n*n - x*x if y2 > 0 and math.sqrt(y2) % 1 == 0: ans += 1 print(ans)