eolymp
bolt
Try our new interface for solving problems
Problems

The sum of divisors

The sum of divisors

Let $n$ be a positive integer. The number $d$ is its divisor if $1 \le d \le n$ and the remainder after dividing $n$ by $d$ is zero. Find the sum of divisors of number $n$. \InputFile One integer $n~(1 \le n \le 10^{18})$, all its prime divisors do not exceed $1000$. \OutputFile Print the sum of divisors of number $n$. \Examples The divisors of $12$ are: $1, 2, 3, 4, 6, 12$. The sum of divisors is $1 + 2 + 3 + 4 + 6 + 12 = 28$.
Time limit 1 second
Memory limit 128 MiB
Input example #1
12
Output example #1
28
Input example #2
239
Output example #2
240