N = int(input()) ans = 0 for i in range(1, 10**3): for j in range(1, 10**3): if i**2+j**2 == N**2: ans += 1 print(ans)