def main(): import sys from math import sqrt input = sys.stdin.readline N = int(input()) div = [] for i in range(1, int(sqrt(N))+1): if N%i == 0: div.append(i) div.append(N//i) if div[-1] ** 2 == N: div.pop() print(sum(div)) if __name__ == '__main__': main()