from collections import defaultdict


class Solution:

    def countPrimes(self, n: int) ->int:
        seen = defaultdict(lambda : True)
        count = 0
        for i in range(2, n):
            if seen[i]:
                count += 1
                init = i * i
                while init < n:
                    seen[init] = False
                    init += i
        return count

c90b27360f8a10ab47762ae78357802519677a98
<mask token>

<mask token>


class Solution:
    <mask token>

<mask token>


class Solution:

    def countPrimes(self, n: int) ->int:
        seen = defaultdict(lambda : True)
        count = 0
        for i in range(2, n):
            if seen[i]:
                count += 1
                init = i * i
                while init < n:
                    seen[init] = False
                    init += i
        return count

from collections import defaultdict


class Solution:

    def countPrimes(self, n: int) ->int:
        seen = defaultdict(lambda : True)
        count = 0
        for i in range(2, n):
            if seen[i]:
                count += 1
                init = i * i
                while init < n:
                    seen[init] = False
                    init += i
        return count
