PCOUNT - Prime Count

How many primes are there between 1 and n where 1<=n<=10^8. Remember that 1 is not prime.

Input

The number n.

Output

Output the number of primes between 1 and n (inclusive).

Example

Input: 5 Output: 3


Added by:Paul Draper
Date:2011-10-06
Time limit:0.100s-1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ASM64

hide comments
2011-10-06 06:20:12 :D
Should be moved to tutorial. There are a lot of very similar problems already, for example CPRIME.
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.