n = int(input()) def sosu_check(num): checker = True for x in range(2, int(num / 2) + 1): if num % x == 0: checker = False break # print(num, checker) return checker counter = 0 for x in range(2, n + 1): for y in range(2, n + 1): for z in range(2, n + 1): if sosu_check(x) and sosu_check(y) and sosu_check(z): # print(x, y, z, z^2 - x - y) if z**2 - x - y == 0: # print(x, y, z) counter += 1 print(counter)