eolymp
bolt
Try our new interface for solving problems
Problems

Remainders sum

Remainders sum

Today at school Petya learnt what is the remainder and how to find it. To practice a bit, he took some integer \textbf{n} and calculated the sum of all remainders after dividing it by all integers from \textbf{1} to \textbf{n}. For example, for \textbf{n = 6}, remainders will be \textbf{0}, \textbf{0}, \textbf{0}, \textbf{2}, \textbf{1}, and \textbf{0}, so their sum is \textbf{3}. Now to check his calculations he asks you to write a program to calculate this sum for any \textbf{n}. \InputFile The only line of input contains integer \textbf{n} (\textbf{1} ≤ \textbf{n} ≤ \textbf{10^9}). \OutputFile Output the sum of remainders.
Time limit 1 second
Memory limit 256 MiB
Input example #1
1
Output example #1
0
Source ACM-ICPC Ukraine 2012, 2nd Stage Ukraine, September 6, 2012