def max_div(n): l, r = 1, n + 1 while r - l > 1: m = (l + r) // 2 if m * m <= n: l = m else: r = m return l def factors(n): f = [] c = 0 while n % 2 == 0: n //= 2 c += 1 if c > 0: f.append((2, c)) # lim = int(n**0.5 + 0.1) lim = max_div(n) for p in range(3, lim + 1, 2): c = 0 while n % p == 0: n //= p c += 1 if c > 0: f.append((p, c)) if n != 1: f.append((n, 1)) return f def factors2(n): f = [] for d in (2, 3): c = 0 while n % d == 0: n //= d c += 1 if c > 0: f.append((d, c)) # lim = int(n**0.5 + 0.1) lim = max_div(n) for k in range(6, lim + 6, 6): for d in (k - 1, k + 1): c = 0 while n % d == 0: n //= d c += 1 if c > 0: f.append((d, c)) if n != 1: f.append((n, 1)) return f N = int(input()) ans = 1 for (p, x) in factors(N): ans *= sum(p**i for i in range(x + 1)) print(ans)