def f(x): ret = [] for i in range(1, int(x**0.5)+1): if x%i==0: ret.append(i) if i!=x//i: ret.append(x//i) return sum(ret) print(f(int(input())))