from math import gcd as g def gcd(a, b, c): return g(a, g(b, c)) L = int(input()) if L < 48: print(0) exit() L //= 4 ans = 0 for m in range(1, int(L ** 0.5) + 10): for n in range(1, m): if 2 * m * (m + n) > L: break a = m*m - n*n b = 2*m*n c = m*m - n*n if gcd(a, b, c) == 1: ans += 1 print(ans)