N = input() if N == 1: print 1 elif N == 2: print 1 else: v = N if N%2 else N/2 ans = 0 for i in range(1,v/2+1): if v % i == 0: ans += i ans += v/i print ans