import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines import numpy as np N = int(read()) x = np.arange(1, 10**6+10, dtype=np.int64) div = x[N%x==0] div = np.union1d(div, N//div) answer = div.sum() print(answer)