n = int(input()) res = 0 for y in range(1, 200010): ans = n ** 2 - y ** 2 if ans > 0 and int(ans ** 0.5) == ans ** 0.5: res += 1 print(res)