target = int(input()) sum = 1+target val = 2 while val <= target//2 : if target % val == 0 : sum += val val += 1 print(sum)