LearnPy Hub
← Arena
IntermediateRating 1200

Count Primes Fast

Count the primes up to n using the Sieve of Eratosthenes.

Input

One integer n (1 ≤ n ≤ 2·10⁶).

Output

A count.

Sample 1

Input
10
Output
4

Sample 2

Input
1
Output
0
solution.py
Output appears here
Count Primes Fast · Python Arena problem · LearnPy Hub