n = int(input()) div = [] for i in range(1, n+1): if (n*n)%i == 0: div.append(i) m = len(div) ans = set() for i in range(m): for j in range(i, m): x, y = div[i], div[j] #formula: xy z^2 + xy(x+y) z - n*n = 0 #answer: (-xy(x+y) +- sqrt(x^2y^2(x+y)^2 + 4n^2xy)) / 2xy if x*x*y*y*(x+y)*(x+y) + 4*n*n*x*y < 0: continue z1 = round((-x*y*(x+y) + (x*x*y*y*(x+y)*(x+y) + 4*n*n*x*y) ** 0.5) / (2*x*y)) z2 = round((-x*y*(x+y) - (x*x*y*y*(x+y)*(x+y) + 4*n*n*x*y) ** 0.5) / (2*x*y)) #print(x, y, z1, z2) if z1 > 0 and x*y*z1*(x+y+z1) == n*n: res = sorted([x, y, z1]) ans.add((res[0], res[1], res[2])) if z2 != z1 and z2 > 0 and x*y*z2*(x+y+z2) == n*n: res = sorted([x, y, z2]) ans.add((res[0], res[1], res[2])) print(len(ans))