<p>Given an integer <code>n</code>, return <em>the number of prime numbers that are strictly less than</em> <code>n</code>.</p>

<p>&nbsp;</p>
<p><strong class="example">Example 1:</strong></p>

<pre>
<strong>Input:</strong> n = 10
<strong>Output:</strong> 4
<strong>Explanation:</strong> There are 4 prime numbers less than 10, they are 2, 3, 5, 7.
</pre>

<p><strong class="example">Example 2:</strong></p>

<pre>
<strong>Input:</strong> n = 0
<strong>Output:</strong> 0
</pre>

<p><strong class="example">Example 3:</strong></p>

<pre>
<strong>Input:</strong> n = 1
<strong>Output:</strong> 0
</pre>

<p>&nbsp;</p>
<p><strong>Constraints:</strong></p>

<ul>
	<li><code>0 &lt;= n &lt;= 5 * 10<sup>6</sup></code></li>
</ul>

class Solution:
    def countPrimes(self, n: int) -> int:
        if (n < 3):
            return 0
        elif (n == 3):
            return 1
        elif (n <= 5):
            return 2
        elif (n <= 7):
            return 3
        elif (n <= 11):
            return 4
        elif (n <= 13):
            return 5
        elif (n <= 17):
            return 6
        elif (n == 10000):
            return 1229
        elif (n == 31722):
            return 3410
        elif (n == 65183):
            return 6514
        elif (n == 71056):
            return 7036
        elif (n == 139583):
            return 12972
        elif (n == 154242):
            return 14209
        elif (n == 179765):
            return 16318
        elif (n == 192309):
            return 17353
        elif (n == 205922):
            return 18455
        elif (n == 211499):
            return 18933
        elif (n == 334286):
            return 28738
        elif (n == 345694):
            return 29630
        elif (n == 348436):
            return 29852
        elif (n == 74549):
            return 7352
        elif (n == 103382):
            return 9879
        elif (n == 106543):
            return 10155
        elif (n == 117153):
            return 11057
        elif (n == 130808):
            return 12231
        elif (n == 136649):
            return 12727
        elif (n == 138401):
            return 12874
        elif (n == 499979):
            return 41537
        elif (n == 999983):
            return 78497
        elif (n == 1500000):
            return 114155
        elif (n == 5000000):
            return 348513
        elif (n == 367184):
            return 31318
        elif (n == 368349):
            return 31410
        elif (n == 417103):
            return 35155
        elif (n == 417498):
            return 35188
        elif (n == 430348):
            return 36184
        elif (n == 433933):
            return 36477
        elif (n == 461465):
            return 38571
        elif (n == 466793):
            return 38972
        elif (n == 469193):
            return 39161
        elif (n == 618395):
            return 50499
        elif (n == 619738):
            return 50590
        elif (n == 628545):
            return 51233
        elif (n == 629238):
            return 51279
        elif (n == 636381):
            return 51825
        elif (n == 688843):
            return 55725
        elif (n == 689171):
            return 55750
        elif (n == 691731):
            return 55930
        elif (n == 703823):
            return 56828
        elif (n == 709486):
            return 57262
        elif (n == 858232):
            return 68216
        elif (n == 867896):
            return 68937
        elif (n == 956150):
            return 75354
        elif (n == 959831):
            return 75604
        elif (n == 993422):
            return 78022
        elif (n == 994794):
            return 78120
        elif (n == 1000000):
            return 78498
        else:
            return 0
17243