import math, strutils let n: int = stdin.readline.parseInt var d: seq[int] i: int = 1 ans: int while i * i <= n: if n mod i == 0: d.add(i) if n != 1: d.add(n div i) i.inc ans = sum(d) echo ans