import math def issqrt(n): x = int(round(math.sqrt(n))) return ((x * x) == n, x) cnt = 0 N = int(input()) N2 = N * N div = [x for x in range(1,N+1) if N2 % x == 0] for u in div: for v in div: if u > v or N2 % (u * v) != 0: continue n = N2 // u // v m = (u + v) * (u + v) + 4 * n f = issqrt(m) if not f[0]: continue m = f[1] if (-(u + v) + m) % 2 != 0: continue w = (-(u + v) + m) // 2 if not (u <= v <= w): continue cnt += 1 print(cnt)