PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN

#GL0000261. Gửi bảng giá trị (Send a Table)

HỌC THEO LỘ TRÌNH

Bài tập thuộc lộ trình

1 lộ trình

Gửi bảng giá trị (Send a Table)

Send a Table

Source: UVa

Version: Phuoc Hung OJ Extended

Problem Statement

Jimmy precomputes a function of ordered positive integer pairs f(x,y)f(x,y) for 1≤x,y≤n1\le x,y\le n. A known value f(x,y)f(x,y) determines f(kx,ky)f(kx,ky) for positive integers kk whose arguments remain in range. Swapping the arguments is not permitted. Find the minimum number of ordered pairs that must be precomputed.

Input

Read one integer nn.

Output

Print the minimum number of entries to precompute.

Subtasks

  • Subtask 1 (20 points): 1≤n≤501\le n\le 50.
  • Subtask 2 (30 points): 1≤n≤50001\le n\le 5000.
  • Subtask 3 (50 points): 1≤n≤500001\le n\le 50000.

Examples

Example 1

Input

2

Output

3

Explanation

The ordered coprime pairs are (1, 1), (1, 2), (2, 1). Their number is 3; none can be scaled down by a common factor.

Example 2

Input

5

Output

19

Explanation

The ordered coprime pairs are (1, 1), (1, 2), (1, 3), (1, 4), (1, 5), (2, 1), (2, 3), (2, 5), (3, 1), (3, 2), (3, 4), (3, 5), (4, 1), (4, 3), (4, 5), (5, 1), (5, 2), (5, 3), (5, 4). Their number is 19; none can be scaled down by a common factor.