import math N = int(input()) result = 0 for i in range(1, 200001): if x > 0 and y > 0 and x**2 + y**2 == N**2: result += 1 print(result)