n=int(input()) ans=set() for i in range(1,n): if n%i==0: ans.add(i) ans.add(n//i) print(sum(ans) if ans else 1)