Buggy python submission (verdict: Time Limit Exceeded):
o_list=[]
while True:
	try:
		n=int(input())
		I_list=[i for i in range(2,n+1)]
		prime_list=[]
		for i in I_list:
			k=I_list[0]
			prime_list.append(k)
			for j in I_list:
				if j%k==0:
					I_list.remove(j)

		K=set(I_list) | set(prime_list)
		K=list(K)
		K=sorted(K)
		o_list.append(len(K))
	except:
		for i in o_list:
			print(i)
		break

Fixed submission:
from math import sqrt
I_list=[]
prime_list=[]
while True:
	try:
		I_list.append(int(input()))
	except:
		break
I_max=max(I_list)
search_set={x for x in range(2,I_max+1)}


p=-1
while p<=sqrt(I_max):
	p=min(search_set)
	prime_list.append(p)
	search_set={x for x in search_set if x%p !=0 }

search_list=sorted(list(search_set))
prime_list+=search_list

#print(prime_list)


for i in I_list:
	lower_set={j for j in prime_list if j<=i } 
#	print(lower_set)
	print(len(lower_set))

Buggy python submission (verdict: Time Limit Exceeded):
from math import sqrt

I_list=[]

#input syutoku

while True:

	try:

		k=int(input())

		I_list.append(k)

	except:

		break



I_max=max(I_list)

#create list (I_max=100 -> [3,5,7,...,99])

odd_list=[x for x in range(3,I_max+1,2)]

#print(W_list)



P_list=[2]



p=0

#print(I_list)

ct=0

while p<=int(sqrt(I_max)):

	p=odd_list.pop(0)

	P_list.append(p)

	P_baisuu=[p*x for x in range(1, int(I_max/p) +1 )]

	K_list=set(odd_list)-set(P_baisuu)

	odd_list=sorted(list(K_list))

#	print("P_list=")

#	print(P_list)

#	print("odd_list=")

#	print(odd_list)



prime_list=P_list+odd_list

#print("prime_list=")

#print(prime_list)



for i in I_list:

	w=[j for j in prime_list if j<=i ]

	print(len(w)) 

Fixed submission:
from math import sqrt
I_list=[]
prime_list=[]
while True:
	try:
		I_list.append(int(input()))
	except:
		break
I_max=max(I_list)
search_set={x for x in range(2,I_max+1)}


p=-1
while p<=sqrt(I_max):
	p=min(search_set)
	prime_list.append(p)
	search_set={x for x in search_set if x%p !=0 }

search_list=sorted(list(search_set))
prime_list+=search_list

#print(prime_list)


for i in I_list:
	lower_set={j for j in prime_list if j<=i } 
#	print(lower_set)
	print(len(lower_set))

Buggy python submission (verdict: Time Limit Exceeded):
from math import sqrt

I_list=[]

#input syutoku

while True:

	try:

		k=int(input())

		I_list.append(k)

	except:

		break



I_max=max(I_list)

#create list (I_max=100 -> [3,5,7,...,99])

odd_list=[x for x in range(3,I_max+1,2)]

#print(W_list)



P_list=[2]



p=0

#print(I_list)

ct=0

while p<=int(sqrt(I_max)):

	p=odd_list.pop(0)

	P_list.append(p)

	P_baisuu=[p*x for x in range(1, int(I_max/p) +1 )]

	K_list=set(odd_list)-set(P_baisuu)

	odd_list=sorted(list(K_list))

#	print("P_list=")

#	print(P_list)

#	print("odd_list=")

#	print(odd_list)



prime_list=P_list+odd_list

#print("prime_list=")

#print(prime_list)



for i in I_list:

	w=[j for j in prime_list if j<=i ]

	print(len(w)) 

Fixed submission:
from math import sqrt
I_list=[]
prime_list=[]
while True:
	try:
		I_list.append(int(input()))
	except:
		break
I_max=max(I_list)
search_set={x for x in range(2,I_max+1)}


p=-1
while p<=sqrt(I_max):
	p=min(search_set)
	prime_list.append(p)
	search_set={x for x in search_set if x%p !=0 }

search_list=sorted(list(search_set))
prime_list+=search_list

#print(prime_list)


for i in I_list:
	lower_set={j for j in prime_list if j<=i } 
#	print(lower_set)
	print(len(lower_set))

Buggy python submission (verdict: Time Limit Exceeded):
from math import sqrt
I_list=[]
#input syutoku
while True:
	try:
		k=int(input())
		I_list.append(k)
	except:
		break

I_max=max(I_list)
#create list (I_max=100 -> [3,5,7,...,99])
odd_list=[x for x in range(3,I_max+1,2)]
#print(W_list)

P_list=[2]

p=0
#print(I_list)
ct=0
while p<=int(sqrt(I_max)):
	p=odd_list.pop(0)
	P_list.append(p)
	P_baisuu=[p*x for x in range(1, int(I_max/p) +1 )]
	K_list=set(odd_list)-set(P_baisuu)
	odd_list=sorted(list(K_list))
#	print("P_list=")
#	print(P_list)
#	print("odd_list=")
#	print(odd_list)

prime_list=P_list+odd_list
#print("prime_list=")
#print(prime_list)

for i in I_list:
	w=[j for j in prime_list if j<=i ]
	print(len(w)) 

Fixed submission:
from math import sqrt
I_list=[]
prime_list=[]
while True:
	try:
		I_list.append(int(input()))
	except:
		break
I_max=max(I_list)
search_set={x for x in range(2,I_max+1)}


p=-1
while p<=sqrt(I_max):
	p=min(search_set)
	prime_list.append(p)
	search_set={x for x in search_set if x%p !=0 }

search_list=sorted(list(search_set))
prime_list+=search_list

#print(prime_list)


for i in I_list:
	lower_set={j for j in prime_list if j<=i } 
#	print(lower_set)
	print(len(lower_set))