P25738 [AtCoder] Fraction Floor Sum
普及
题目描述

Problem Statement

Given is a positive integer N.
Find the value $\displaystyle\sum_{i=1}^N \left[ \frac{N}{i} \right]$.
Here, for a real number x, [x] denotes the largest integer not exceeding x.

Input

Input is given from Standard Input in the following format:
N

Output

Print the answer.

Constraints

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

Sample Input 1

3

Sample Output 1

5

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

Sample Input 2

10000000000

Sample Output 2

231802823220

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

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
3
样例输出
5