TopCoder

User's AC Ratio

100.0% (2/2)

Submission's AC Ratio

66.7% (2/3)

Tags

Description

給定一個正整數 $N$ ,請問 $1 \sim N$ 中有幾個質數?

Input Format

輸入有一行,第一行有一個正整數代表題目中的 $N$。

  • $2 \le N \le 10^ 7$

Output Format

輸出有一行,包含一個正整數,代表 $1 \sim N$ 中質數的數量。

Sample Input 1

10

Sample Output 1

4

Hints

Problem Source

Subtasks

No. Testdata Range Constraints Score
1 0 範例測資 0
2 0~20 無額外限制 100

Testdata and Limits

No. Time Limit (ms) Memory Limit (VSS, KiB) Output Limit (KiB) Subtasks
0 500 524288 65536 1 2
1 500 524288 65536 2
2 500 524288 65536 2
3 500 524288 65536 2
4 500 524288 65536 2
5 500 524288 65536 2
6 500 524288 65536 2
7 500 524288 65536 2
8 500 524288 65536 2
9 500 524288 65536 2
10 500 524288 65536 2
11 500 524288 65536 2
12 500 524288 65536 2
13 500 524288 65536 2
14 500 524288 65536 2
15 500 524288 65536 2
16 500 524288 65536 2
17 500 524288 65536 2
18 500 524288 65536 2
19 500 524288 65536 2
20 500 524288 65536 2