n = int(input()) cnt = 0 for x in range(1, n+1): for y in range(1, n+1): if (pow(x, 2) + pow(y, 2))**0.5 == n: cnt += 1 print(cnt)