import std; long sumDivisors(long n) { long sum = 0; for (long i = 1; i * i <= n; i++) { if (n % i == 0) { sum += i; if (n / i != i) sum += n / i; } } return sum; } void main() { long n; scan(n); writeln(sumDivisors(n)); } void scan(T...)(ref T a) { string[] ss = readln.split; foreach (i, t; T) a[i] = ss[i].to!t; } T read(T)() { return readln.chomp.to!T; } T[] reads(T)() { return readln.split.to!(T[]); } alias readint = read!int; alias readints = reads!int;