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