def divisors(n): divs = [] for d in range(1, int(n**0.5) + 1): if n % d == 0: divs.append(d) q = n // d if q != d: divs.append(q) return divs def divisors2(n): divs = [] lim = int(n**0.5) d = 1 while d <= lim: if n % d == 0: divs.append(d) q = n // d if q != d: divs.append(q) d += 1 return divs print(sum(divisors2(int(input()))))