from sys import stdin def main(): input = lambda: stdin.readline()[:-1] N = int(input()) n = int(N ** 0.5) a = set() for i in range(1, n + 1): div_, mod_ = divmod(N, i) if not mod_: a.add(i) a.add(div_) print(sum(a)) main()