Buggy python submission (verdict: Time Limit Exceeded):
import sys

for line in sys.stdin:
	lis = []
	i = 2
	while i <= int(line):
		j = 1
		while j <= i-2:
			if i % (j+1) == 0:
				break
			j += 1
		else:
			lis.append(i)
		i += 1
	print len(lis)	

Fixed submission:
import sys
N = 999999
lis = []
if N >= 2:
	lis.append(2)
if  N >= 3:
	lis.append(3)
if N >= 5:
	for i in xrange(5,N+1,2):
		for item in lis:
			if item > (i**0.5):
				lis.append(i)
				break
			if i % item == 0:
				break
		else:
			lis.append(i)
dp = [0]*999999
for item in lis:
	dp[item-1] += 1
for i in xrange(1,999999):
	dp[i] += dp[i-1]

for line in sys.stdin:
	num = int(line)
	print dp[num-1]

Buggy python submission (verdict: Time Limit Exceeded):
import sys

for line in sys.stdin:
	i = 5
	lis = [2,3]
	while i <= int(line):
		if i % 3 != 0:
			j = 5
			while j <= int(i**0.5):
				if j % 3 != 0:
					if i % j == 0:
						break
				j += 2
			else:
				lis.append(i)
		i += 2
	print len(lis)

Fixed submission:
import sys
N = 999999
lis = []
if N >= 2:
	lis.append(2)
if  N >= 3:
	lis.append(3)
if N >= 5:
	for i in xrange(5,N+1,2):
		for item in lis:
			if item > (i**0.5):
				lis.append(i)
				break
			if i % item == 0:
				break
		else:
			lis.append(i)
dp = [0]*999999
for item in lis:
	dp[item-1] += 1
for i in xrange(1,999999):
	dp[i] += dp[i-1]

for line in sys.stdin:
	num = int(line)
	print dp[num-1]

Buggy python submission (verdict: Runtime Error):
import sys
for line im sys.stdin:
	lis = []
	if line >= 2:
		lis.append(2)
	if  line >= 3:
		lis.append(3)
	if line >= 5:
		for i in xrange(5,line+1,2):
			for item in lis:
				if item > (i**0.5):
					lis.append(i)
					break
				if i % item == 0:
					break
			else:
				lis.append(i)
	print len(lis)

Fixed submission:
import sys
N = 999999
lis = []
if N >= 2:
	lis.append(2)
if  N >= 3:
	lis.append(3)
if N >= 5:
	for i in xrange(5,N+1,2):
		for item in lis:
			if item > (i**0.5):
				lis.append(i)
				break
			if i % item == 0:
				break
		else:
			lis.append(i)
dp = [0]*999999
for item in lis:
	dp[item-1] += 1
for i in xrange(1,999999):
	dp[i] += dp[i-1]

for line in sys.stdin:
	num = int(line)
	print dp[num-1]

Buggy python submission (verdict: Time Limit Exceeded):
import sys
for line in sys.stdin:
	lis = []
	num = int(line)
	if num >= 2:
		lis.append(2)
	if  num >= 3:
		lis.append(3)
	if num >= 5:
		for i in xrange(5,num+1,2):
			for item in lis:
				if item > (i**0.5):
					lis.append(i)
					break
				if i % item == 0:
					break
			else:
				lis.append(i)
	print len(lis)

Fixed submission:
import sys
N = 999999
lis = []
if N >= 2:
	lis.append(2)
if  N >= 3:
	lis.append(3)
if N >= 5:
	for i in xrange(5,N+1,2):
		for item in lis:
			if item > (i**0.5):
				lis.append(i)
				break
			if i % item == 0:
				break
		else:
			lis.append(i)
dp = [0]*999999
for item in lis:
	dp[item-1] += 1
for i in xrange(1,999999):
	dp[i] += dp[i-1]

for line in sys.stdin:
	num = int(line)
	print dp[num-1]

Buggy python submission (verdict: Runtime Error):
import sys
N = 999999
lis = []
if N >= 2:
	lis.append(2)
if  N >= 3:
	lis.append(3)
if N >= 5:
	for i in xrange(5,N+1,2):
		for item in lis:
			if item > (i**0.5):
				lis.append(i)
				break
			if i % item == 0:
				break
		else:
			lis.append(i)
dp = [0]*999999
for item in lis:
	dp[item-1] += 1
for i in xrange(1,999999):
	dp[i] += dp[i-1]

for line in sys.stdin:
	num = int(line)
	print dp[line-1]

Fixed submission:
import sys
N = 999999
lis = []
if N >= 2:
	lis.append(2)
if  N >= 3:
	lis.append(3)
if N >= 5:
	for i in xrange(5,N+1,2):
		for item in lis:
			if item > (i**0.5):
				lis.append(i)
				break
			if i % item == 0:
				break
		else:
			lis.append(i)
dp = [0]*999999
for item in lis:
	dp[item-1] += 1
for i in xrange(1,999999):
	dp[i] += dp[i-1]

for line in sys.stdin:
	num = int(line)
	print dp[num-1]