from math import gcd l = int(input()) // 4 lst = [] m = 2 ans = 0 while 1: if 2 * m * (m + 1) >= l: break n = 1 while n < m and 2 * m * (m + n) <= l: a, b, c = m * m - n * n, 2 * m * n, m * m + n * n if gcd(gcd(a, b), c) == 1: ans += 1 n += 1 m += 1 print(ans)