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

#SP0000115. Giả thuyết của Henry

HỌC THEO LỘ TRÌNH

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

1 lộ trình

Giả thuyết của Henry

Henry's Conjecture

Source: LQDOJ primehenry (cross-checked via the HNCode mirror).

Version: Phước Hưng OJ Extended.

Problem Statement

Henry conjectures that there is a positive integer nn such that n⋅m+1n\cdot m+1 is prime for every positive integer mm. Given nn, produce a counterexample: any positive integer mm for which n⋅m+1n\cdot m+1 is not prime.

Multiple answers may be correct.

Input

One positive integer nn.

Output

Output one integer mm such that 1≤m≤10001\le m\le1000 and n⋅m+1n\cdot m+1 is composite.

Subtask

  • Subtask 1 (20 points): 1≤n≤301\le n\le30.
  • Subtask 2 (30 points): 1≤n≤2001\le n\le200.
  • Subtask 3 (50 points): 1≤n≤10001\le n\le1000.

Example

Input

5

Output

3

Explanation

For n=5n=5, taking m=3m=3 yields 5⋅3+1=16=425\cdot3+1=16=4^2, which is composite.