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

#SP0000082. Tổng các số có ước thực sự lớn nhất bằng K (Count N)

HỌC THEO LỘ TRÌNH

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

1 lộ trình

Tổng các số có ước thực sự lớn nhất bằng K (Count N)

Count N

Source: CodeChef

Version: Phuoc Hung OJ Extended

Problem Statement

For a positive integer NN, let f(N)f(N) be the greatest positive divisor strictly smaller than NN, with f(1)=0f(1)=0. Given K≥2K\ge2, compute the sum of all positive integers NN such that f(N)=Kf(N)=K. Use a 6464-bit integer for the answer.

Input

One line containing the integer KK.

Output

Print one integer: the required sum.

Subtasks

  • Subtask 1 (20 points): 2≤K≤10002\le K\le 1000.
  • Subtask 2 (30 points): 2≤K≤1000002\le K\le 100000.
  • Subtask 3 (50 points): 2≤K≤10000002\le K\le 1000000.

Examples

Input

6

Output

12

Explanation

For K=6K=6, its smallest prime divisor is 22. The only valid number is N=6⋅2=12N=6\cdot2=12: the greatest proper divisor of 1212 is 66. Hence the answer is 1212.