Under construction

Still being built. Things may change

Trial Problem

Time limit1sMemory limit128 MB

Summary
Given n up to 2010, compute the final value of the triple loop that adds each floored s*k/i term modulo 2010.
Level

Medium7 of 10

Topics
Math, Number theory
Solved
No attempts yet

Problem

You are given an integer n. Run the following C code exactly as written. After all three nested loops finish, determine the value of the variable ret.

int ret = 0;
for(int s = 1; s<=n; s++) {
  for(int k = s; k<=n; k++) {
    for(int i = k; i<=n; i++) {
      ret = (ret+s*k/i)%2010;
    }
  }
}

Here s*k/i is C integer division (it discards the fractional part), and because ret is reduced modulo 2010 on every iteration, ret always stays between 0 and 2009 inclusive.

Input

The first and only line of input contains the integer n (1≤n≤20101 \le n \le 2010).

Output

Print the final value of the variable ret on a single line after the loop has fully executed.

Examples3

  1. Example 1

    Input
    1
    
    Expected output
    1
    
  2. Example 2

    Input
    2
    
    Expected output
    4
    
  3. Example 3

    Input
    5
    
    Expected output
    48