luogu#P3912. 素数个数

素数个数

Problem Description

Find the number of primes among 1,2,,N1, 2, \cdots, N.

Input Format

One line containing an integer NN.

Output Format

One line containing an integer, representing the number of primes.

10
4

Hint

For 40%40\% of the testdata, 1N1061 \le N \le 10^6.

For 80%80\% of the testdata, 1N1071 \le N \le 10^7.

For 100%100\% of the testdata, 1N1081 \le N \le 10^8.

Translated by ChatGPT 5