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

#GL0000009. Chọn bội số có tổng lớn nhất (Maximum Multiple Sum)

HỌC THEO LỘ TRÌNH

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

1 lộ trình

Chọn bội số có tổng lớn nhất (Maximum Multiple Sum)

Maximum Multiple Sum

Source: Codeforces

Version: Phuoc Hung OJ Extended

Problem Statement

Given nn, choose an integer xx with 2≤x≤n2\le x\le n that maximizes the sum of all positive multiples of xx not exceeding nn. The optimal choice is guaranteed unique.

Input

One line containing integer nn.

Output

Print the optimal value of xx.

Subtasks

  • Subtask 1 (20 points): 2≤n≤152 \le n \le 15
  • Subtask 2 (30 points): 2≤n≤502 \le n \le 50
  • Subtask 3 (50 points): 2≤n≤1002 \le n \le 100

Examples

Input

15

Output

2

Explanation

Choosing x=2x=2 gives 2+4+6+8+10+12+14=562+4+6+8+10+12+14=56, the largest possible sum.