def divisor(x): i=1 l=[] while i * i <= x: if x%i == 0: l.append(i) l.append(x//i) i+=1 l = list(set(l)) return l n=int(input()) print(sum(divisor(n)))