atcoder#ABC230E. [ABC230E] Fraction Floor Sum

[ABC230E] Fraction Floor Sum

Score : 500500 points

Problem Statement

Given is a positive integer NN. Find the value $\displaystyle\sum_{i=1}^N \left[ \frac{N}{i} \right]$.

Here, for a real number xx, [x][x] denotes the largest integer not exceeding xx.

Constraints

  • 1N10121 \leq N \leq 10^{12}
  • NN is an integer.

Input

Input is given from Standard Input in the following format:

NN

Output

Print the answer.

3
5

We have $\left[ \frac{3}{1} \right]+\left[ \frac{3}{2} \right]+\left[ \frac{3}{3} \right]=3+1+1=5$.

10000000000
231802823220

Note that the input and output may not fit into a 3232-bit integer type.