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

#SP0000118. Chọn số nguyên tố để tổng không nguyên tố (Factorise N+M)

HỌC THEO LỘ TRÌNH

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

1 lộ trình

Chọn số nguyên tố để tổng không nguyên tố (Factorise N+M)

Factorise N+M

Source: Codeforces

Version: Phuoc Hung OJ Extended

Problem Statement

Given a prime number nn, find a prime number mm with 2≤m≤1052\le m\le10^5 such that n+mn+m is not prime.

A prime is an integer greater than 11 with exactly two positive divisors. Any valid mm is accepted, and a solution is guaranteed to exist.

Input

One line containing the prime integer nn.

Output

Print a prime mm satisfying 2≤m≤1052\le m\le10^5 such that n+mn+m is composite.

Subtasks

  • Subtask 1 (20 points): nn is prime; 2≤n≤1002\le n\le100; 2≤m≤1052\le m\le10^5.
  • Subtask 2 (30 points): nn is prime; 2≤n≤1042\le n\le10^4; 2≤m≤1052\le m\le10^5.
  • Subtask 3 (50 points): nn is prime; 2≤n≤1052\le n\le10^5; 2≤m≤1052\le m\le10^5.

Examples

Input

7

Output

7

Explanation

The input n=7n=7 is prime. Choose m=7m=7, which is prime and within the allowed range. Then n+m=14=2⋅7n+m=14=2\cdot7 is composite, so printing 7 is valid.