At a trolleybus stop, passengers, including Petryk and Ivanko, board the trolleybus. Petryk buys the first ticket, whose number is a prime. Ivanko notices this and decides he also wants to get a ticket with a prime number. Tickets are issued sequentially, starting from Petryk's ticket number, and there is only one roll of consecutively numbered tickets for all passengers.
The input contains two numbers: — the number of passengers, and the ticket number on Petryk's ticket. The ticket number contains at most digits.
Output the number of passengers Ivanko must let go ahead of him to obtain a ticket with a prime number. If it is impossible for Ivanko to get such a ticket before the tickets run out, output .
Example 1
Example 4