n=int(input()) yaku=[] for i in range(1,int(n**0.5)+1): if n%i==0: yaku.append(i) if i == n//i: continue yaku.append(n//i) print(sum(yaku))