401918: GYM100574 E Valentine's Exam

Memory Limit:64 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

E. Valentine's Examtime limit per test1 secondmemory limit per test64 megabytesinputstandard inputoutputstandard output

Saleh was hanging out hole Valentine's day with his love, Sahel. Today is February 15 and he has a mathematics exam and he doesn't know anything about prime decomposition. He is not an idiot and he can figure out how to decompose a number into primes, but right now he can't focus and the only thing he can do is singing in his head,

"I don't know you,  but I need more time

Promise me you'll be mine

Birds are flying over Europe's skies

Tell me please why can't I?..."

He asked you to help him and given storages n 0 0 0 using IDXT language calculate the following number and put it in the first storage :

where and p1 < p2 < ... < pk and for each i, pi is a prime number.

Your program's order mustn't exceed 107 .

Input

Storages with values n 0 0 0 in order.

1 ≤ n ≤ 105

Output

The first storage should contain the answer.

ExamplesInput
8 0 0 0
Output
3
Input
200 0 0 0
Output
5

加入题单

算法标签: