Buggy python submission (verdict: Time Limit Exceeded):
while True:
	ans = 0
	try:
		limit = input()
		for n in range(2, limit + 1):
			for x in range(2, n):
				if n % x == 0:
					break
			else:
					ans = ans + 1
		print ans
	except EOFError:
		pass

Fixed submission:
def prime_count(n):
	j = 0
	ans = [1] * (n + 1)
	ans[0] = ans[1] = 0
	for i in xrange(3, n + 1, 2):
		if i * 2 > n:
			break
		if ans[i] != 0:
			for j in xrange(2 * i, n + 1, i):
				ans[j] = 0
	for k in xrange(2 * 2, n + 1, 2):
		ans[k] = 0
	print sum(ans)

try:
	while True:
		n = input()
		prime_count(n)
except EOFError:
	pass

Buggy python submission (verdict: Time Limit Exceeded):
try:
	while True:
		ans = 0
		limit = input()
		for n in range(2, limit + 1):
			for x in range(2, n):
				if n % x == 0:
					break
			else:
					ans = ans + 1
		print ans
except EOFError:
	pass

Fixed submission:
def prime_count(n):
	j = 0
	ans = [1] * (n + 1)
	ans[0] = ans[1] = 0
	for i in xrange(3, n + 1, 2):
		if i * 2 > n:
			break
		if ans[i] != 0:
			for j in xrange(2 * i, n + 1, i):
				ans[j] = 0
	for k in xrange(2 * 2, n + 1, 2):
		ans[k] = 0
	print sum(ans)

try:
	while True:
		n = input()
		prime_count(n)
except EOFError:
	pass

Buggy python submission (verdict: Time Limit Exceeded):
try:
	while True:
		ans = [2]
		limit = input()
		for n in range(2, limit + 1):
			i = 1
			while True:
				if n % ans[i-1] == 0:
					break
				else:
					if(i == len(ans)):
						ans.append(n)
					i = i + 1
		print len(ans)
except EOFError:
	pass

Fixed submission:
def prime_count(n):
	j = 0
	ans = [1] * (n + 1)
	ans[0] = ans[1] = 0
	for i in xrange(3, n + 1, 2):
		if i * 2 > n:
			break
		if ans[i] != 0:
			for j in xrange(2 * i, n + 1, i):
				ans[j] = 0
	for k in xrange(2 * 2, n + 1, 2):
		ans[k] = 0
	print sum(ans)

try:
	while True:
		n = input()
		prime_count(n)
except EOFError:
	pass

Buggy python submission (verdict: Time Limit Exceeded):
try:
	while True:
		ans = [2]
		limit = input()
		for n in range(3, limit + 1, 2):
			i = 1
			while True:
				if n % ans[i-1] == 0:
					break
				else:
					if(i == len(ans)):
						ans.append(n)
					i = i + 1
		print len(ans)
except EOFError:
	pass

Fixed submission:
def prime_count(n):
	j = 0
	ans = [1] * (n + 1)
	ans[0] = ans[1] = 0
	for i in xrange(3, n + 1, 2):
		if i * 2 > n:
			break
		if ans[i] != 0:
			for j in xrange(2 * i, n + 1, i):
				ans[j] = 0
	for k in xrange(2 * 2, n + 1, 2):
		ans[k] = 0
	print sum(ans)

try:
	while True:
		n = input()
		prime_count(n)
except EOFError:
	pass

Buggy python submission (verdict: Time Limit Exceeded):
try:
	while True:
		ans = [5]
		limit = input()
		for n in range(3, limit + 1, 2):
			i = 0
			while True:
				if n % ans[i] == 0:
					break
				else:
					if(i+1 == len(ans)):
						ans.append(n)
					i = i + 1
		print len(ans) + 1
except EOFError:
	pass

Fixed submission:
def prime_count(n):
	j = 0
	ans = [1] * (n + 1)
	ans[0] = ans[1] = 0
	for i in xrange(3, n + 1, 2):
		if i * 2 > n:
			break
		if ans[i] != 0:
			for j in xrange(2 * i, n + 1, i):
				ans[j] = 0
	for k in xrange(2 * 2, n + 1, 2):
		ans[k] = 0
	print sum(ans)

try:
	while True:
		n = input()
		prime_count(n)
except EOFError:
	pass

Buggy python submission (verdict: Time Limit Exceeded):
try:
	while True:
		limit = input()
		ans = [2]
		for i in range(3, limit + 1, 2):
			k = 0
			while len(ans) != k:
				if i % ans[k] == 0:
					break
				else:
					if len(ans) == k + 1:
						ans.append(i)
				k = k + 1
				print len(ans)
		print len(ans)
except EOFError:
	pass

Fixed submission:
def prime_count(n):
	j = 0
	ans = [1] * (n + 1)
	ans[0] = ans[1] = 0
	for i in xrange(3, n + 1, 2):
		if i * 2 > n:
			break
		if ans[i] != 0:
			for j in xrange(2 * i, n + 1, i):
				ans[j] = 0
	for k in xrange(2 * 2, n + 1, 2):
		ans[k] = 0
	print sum(ans)

try:
	while True:
		n = input()
		prime_count(n)
except EOFError:
	pass

Buggy python submission (verdict: Time Limit Exceeded):
try:
	while True:
		n = input()
		ans = [1] * (n + 1);
		ans[0] = ans[1] = 0;
		for i in range(2, n + 1):
			if ans[i] != 0:
				for j in range(2 * i, n + 1, i):
					ans[j] = 0
		print sum(ans)
except EOFError:
	pass

Fixed submission:
def prime_count(n):
	j = 0
	ans = [1] * (n + 1)
	ans[0] = ans[1] = 0
	for i in xrange(3, n + 1, 2):
		if i * 2 > n:
			break
		if ans[i] != 0:
			for j in xrange(2 * i, n + 1, i):
				ans[j] = 0
	for k in xrange(2 * 2, n + 1, 2):
		ans[k] = 0
	print sum(ans)

try:
	while True:
		n = input()
		prime_count(n)
except EOFError:
	pass

Buggy python submission (verdict: Time Limit Exceeded):
try:
	while True:
		j = 0
		n = input()
		ans = [1] * (n + 1);
		ans[0] = ans[1] = 0;
		for i in range(2, n + 1):
			if i * 2 > n:
				break
			if ans[i] != 0:
				for j in range(2 * i, n + 1, i):
					ans[j] = 0
		print sum(ans)
except EOFError:
	pass

Fixed submission:
def prime_count(n):
	j = 0
	ans = [1] * (n + 1)
	ans[0] = ans[1] = 0
	for i in xrange(3, n + 1, 2):
		if i * 2 > n:
			break
		if ans[i] != 0:
			for j in xrange(2 * i, n + 1, i):
				ans[j] = 0
	for k in xrange(2 * 2, n + 1, 2):
		ans[k] = 0
	print sum(ans)

try:
	while True:
		n = input()
		prime_count(n)
except EOFError:
	pass

Buggy python submission (verdict: Time Limit Exceeded):
try:
	while True:
		j = 0
		n = input()
		ans = [1] * (n + 1);
		ans[0] = ans[1] = 0;
		for i in range(3, n + 1, 2):
			if i * 2 > n:
				break
			if ans[i] != 0:
				for j in range(2 * i, n + 1, i):
					ans[j] = 0
		for k in range(2 * 2, n + 1, 2):
			ans[k] = 0
		print sum(ans)
except EOFError:
	pass

Fixed submission:
def prime_count(n):
	j = 0
	ans = [1] * (n + 1)
	ans[0] = ans[1] = 0
	for i in xrange(3, n + 1, 2):
		if i * 2 > n:
			break
		if ans[i] != 0:
			for j in xrange(2 * i, n + 1, i):
				ans[j] = 0
	for k in xrange(2 * 2, n + 1, 2):
		ans[k] = 0
	print sum(ans)

try:
	while True:
		n = input()
		prime_count(n)
except EOFError:
	pass

Buggy python submission (verdict: Time Limit Exceeded):
try:
	while True:
		j = 0
		n = input()
		ans = [1] * (n + 1);
		ans[0] = ans[1] = 0;
		for i in xrange(3, n + 1, 2):
			if i * 2 > n:
				break
			if ans[i] != 0:
				for j in xrange(2 * i, n + 1, i):
					ans[j] = 0
		for k in xrange(2 * 2, n + 1, 2):
			ans[k] = 0
		print sum(ans)
except EOFError:
	pass

Fixed submission:
def prime_count(n):
	j = 0
	ans = [1] * (n + 1)
	ans[0] = ans[1] = 0
	for i in xrange(3, n + 1, 2):
		if i * 2 > n:
			break
		if ans[i] != 0:
			for j in xrange(2 * i, n + 1, i):
				ans[j] = 0
	for k in xrange(2 * 2, n + 1, 2):
		ans[k] = 0
	print sum(ans)

try:
	while True:
		n = input()
		prime_count(n)
except EOFError:
	pass