n = int(input()) arr = [] ans = 0 #for i in range(1, n // 2 + 1): for i in range(1, int(n**0.5 )+1): #print(i) if n % i == 0: arr.append(i) ans += i if i != n // i: arr.append(n//i) ans += n//i #ans += n #print(arr) print(ans)