import math N = int(input()) twoN = math.pow(N, 2) count = 0 for x in range(N): y = math.sqrt(twoN - math.pow(x+1, 2)) if y > 1 and y == int(y): count += 1 print(count)