def parse(inFile):
return inFile.getInt()
def primes(N):
P = range(N+1)
p = 2
while (p * p <= N):
if P[p]:
P[p*p::p] = [0] * (1 + (N / p) - p)
p += 1
P[1] = 0
return [p for p in P if p]
P = primes(10 ** 6)
pows = [1]
for p in P:
print p
k = p * p
while k <= 10 ** 12:
pows.append(k)
k = k * p
pows.sort()
def solve(N):
if (N == 1): return 0
return len([z for z in pows if z <= N])
if __name__ == "__main__":
from GCJ import GCJ
GCJ(parse, solve, "/Users/lpebody/gcj/2011_round2/", "c").run()
ZGVmIHBhcnNlKGluRmlsZSk6CiAgICByZXR1cm4gaW5GaWxlLmdldEludCgpCgpkZWYgcHJpbWVzKE4pOgogICAgUCA9IHJhbmdlKE4rMSkKICAgIHAgPSAyCiAgICB3aGlsZSAocCAqIHAgPD0gTik6CiAgICAgICAgaWYgUFtwXToKICAgICAgICAgICAgUFtwKnA6OnBdID0gWzBdICogKDEgKyAoTiAvIHApIC0gcCkKICAgICAgICBwICs9IDEKICAgIFBbMV0gPSAwCiAgICByZXR1cm4gW3AgZm9yIHAgaW4gUCBpZiBwXQoKUCA9IHByaW1lcygxMCAqKiA2KQpwb3dzID0gWzFdCmZvciBwIGluIFA6CiAgICBwcmludCBwCiAgICBrID0gcCAqIHAKICAgIHdoaWxlIGsgPD0gMTAgKiogMTI6CiAgICAgICAgcG93cy5hcHBlbmQoaykKICAgICAgICBrID0gayAqIHAKcG93cy5zb3J0KCkKCmRlZiBzb2x2ZShOKToKICAgIGlmIChOID09IDEpOiByZXR1cm4gMAogICAgcmV0dXJuIGxlbihbeiBmb3IgeiBpbiBwb3dzIGlmIHogPD0gTl0pCgppZiBfX25hbWVfXyA9PSAiX19tYWluX18iOgogICAgZnJvbSBHQ0ogaW1wb3J0IEdDSgogICAgR0NKKHBhcnNlLCBzb2x2ZSwgIi9Vc2Vycy9scGVib2R5L2djai8yMDExX3JvdW5kMi8iLCAiYyIpLnJ1bigpCgogICAgICAgICAgICAK