I'm trying to improve this so it will pass the time limit constraint, but I don't know where this can be modified. Any suggestions? Thanks!

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