def div(n): i = 1 SS = set() while i * i <= n: if n % i == 0: SS.add(i) SS.add(n//i) i += 1 return sum(list(SS)) print(div(int(input())))