Time limit
2s
Memory limit
128 MB
For natural numbers A and C, C is a divisor of A if there exists a natural number B such that A = B × C. Every natural number N always has 1 and N as divisors.
In this problem, a divisor of N other than 1 and N is called a proper divisor. For example, the proper divisors of 6 are 2 and 3, while 13 has no proper divisors.
Define SOD(n) as the sum of all proper divisors of the natural number n. Thus SOD(6) = 5 and SOD(13) = 0. Also define CSOD(n) as SOD(1) + SOD(2) + ... + SOD(n).
Given an integer n, compute CSOD(n).
The first line contains an integer n.
Print the remainder when CSOD(n) is divided by 1,000,000.