Mediummathsievearrays
Count Primes
Time limit 2 s · Memory 64 MBAcceptance: 100.0%Solved by: 1
Statement
You are given an integer n. Print how many prime numbers lie between 1 and n inclusive.
Examples
Example 1
Input
10
Output
4
Example 2
Input
1
Output
0
Constraints
- 1 ≤ n ≤ 10^6