import math n=int(input()) cnt=0 for i in range(1,int(math.sqrt(n))+1): if n%i==0: if i!=n//i: cnt+=(i+n//i) else: cnt+=i print(cnt)