from bisect import bisect_right n = int(input()) Sqr = [0 for _ in range(n + 1)] for i in range(n + 1): Sqr[i] = i**2 ans = 0 for i in range(1, n): j = (n - i) * (n + i) ind = bisect_right(Sqr, j) if Sqr[ind - 1] == j: ans += 1 print(ans)