def divisor_list(N): #約数のリスト if N == 1: return [1] res = [] for i in range(1,N): if i*i >= N: break if N%i == 0: res.append(i) res.append(N//i) if i*i == N: res.append(i) return sorted(res) n = int(input()) N = n*n div = divisor_list(N) # pqr(p+q+r) = n*n なる (p,q,r)を求める ans = 0 L = len(div) for i,p in enumerate(div): if p*p > n: break for j in range(i,L): q = div[j] if p*q*q*(p+q+q) > N: break if N%(p*q): continue NN = N//p//q for k in range(j,L): r = div[k] V = r*(p+q+r) if V == NN: ans += 1 elif V > NN: break print(ans)