<s> """<STR_LIT>""" <EOL> import math <EOL> __author__ = '<STR_LIT>' <EOL> class Solution : <EOL> def countPrimes ( self , n ) : <EOL> """<STR_LIT>""" <EOL> if n < <NUM_LIT:3> : <EOL> return <NUM_LIT:0> <EOL> is_prime = [ True for _ in xrange ( n ) ] <EOL> is_prime [ <NUM_LIT:0> ] , is_prime [ <NUM_LIT:1> ] = False , False <EOL> for i in xrange ( <NUM_LIT:2> , int ( math . sqrt ( n ) ) + <NUM_LIT:1> ) : <EOL> if is_prime [ i ] : <EOL> for j in xrange ( i * i , n , i ) : <EOL> is_prime [ j ] = False <EOL> return is_prime . count ( True ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> assert Solution ( ) . countPrimes ( <NUM_LIT> ) == <NUM_LIT> </s>
