n=int(input()) i=1 a,b=[],[] while i*i<=n: if n%i==0: a.append(i) if i!=n//i: b.append(n//i) i+=1 print(sum(a+b[::-1]))