class osa_k: min_factor = [] def __init__(self, n): self.min_factor = list(range(n + 1)) i = 2 while i * i <= n: if self.min_factor[i] < i: i += 1 continue for j in range(i*i, n + 1, i): if self.min_factor[j] == j: self.min_factor[j] = i i += 1 def factor(self, n): res = [] while n > 1: res.append(self.min_factor[n]) n //= self.min_factor[n] return res def divisors(self, n): res = [1] while n > 1: x = self.min_factor[n] cnt = 0 while n % x == 0: cnt += 1 n //= x t = [] p = 1 for i in range(cnt + 1): for j in range(len(res)): t.append(res[j] * p) p *= x res = t[:] return res os = osa_k(1000) n = int(input()) d = os.divisors(n) a = 0 b = 1 for i in range(len(d)): a += d[i] b *= d[i] c = 0 for i in range(len(d)): c += b // d[i] print(a * b // c)