__author__ = 'myang'


class Solution:
    # @param {integer} n
    # @return {integer}
    def countPrimes(self, n):
        if n < 2:
            return 0
        flag = [True] * n
        flag[0], flag[1] = False, False
        i = 2
        while i * i < n:
            if flag[i]:
                j = i
                while j * i < n:
                    flag[j * i] = False
                    j += 1
            i += 1
        return sum(flag)
f0fab5d7e2b1bbdcdc70a998865f1486470b0257
<mask token>

<mask token>


class Solution:
    <mask token>

<mask token>


class Solution:

    def countPrimes(self, n):
        if n < 2:
            return 0
        flag = [True] * n
        flag[0], flag[1] = False, False
        i = 2
        while i * i < n:
            if flag[i]:
                j = i
                while j * i < n:
                    flag[j * i] = False
                    j += 1
            i += 1
        return sum(flag)

__author__ = 'myang'


class Solution:

    def countPrimes(self, n):
        if n < 2:
            return 0
        flag = [True] * n
        flag[0], flag[1] = False, False
        i = 2
        while i * i < n:
            if flag[i]:
                j = i
                while j * i < n:
                    flag[j * i] = False
                    j += 1
            i += 1
        return sum(flag)

__author__ = 'myang'


class Solution:
    # @param {integer} n
    # @return {integer}
    def countPrimes(self, n):
        if n < 2:
            return 0
        flag = [True] * n
        flag[0], flag[1] = False, False
        i = 2
        while i * i < n:
            if flag[i]:
                j = i
                while j * i < n:
                    flag[j * i] = False
                    j += 1
            i += 1
        return sum(flag)