N = int(input()) count = 0 for x in range(N): for y in range(N): if x**2 + y**2 == N**2: count += 1 if x**2 + y**2 > N**2: break print(count)