Buggy python submission (verdict: Time Limit Exceeded):
while True:
    try:
        n = int(input())
        prime_cnt = 0

        for i in range(2, n+1):
            cnt = 0
            for j in range(1,i):
                if i % j == 0:
                    cnt = cnt + 1
                    
            if cnt == 1:
                #?´???°
                prime_cnt = prime_cnt + 1
                

        print(str(prime_cnt))
    except:
        break
    

Fixed submission:
#init
max_num = 1000000
is_prime_num = [True for i in range (max_num+1)]

#0, 1 --- not prime number
is_prime_num[0] = False
is_prime_num[1] = False
end = int(max_num ** .5)

for i in range(2, end+1):
    if is_prime_num[i]:
        for j in range(i*i, max_num+1, i):
            is_prime_num[j] = False


while True:
    try:
        n = int(input())
        prime_cnt = 0
        for i in range(1, n+1):
            if is_prime_num[i]:
                prime_cnt = prime_cnt + 1
                   
   
        print(str(prime_cnt))
    except:
        break

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

while True:
    try:
        n = int(input())
        prime_cnt = 0

        for i in range(2, n+1):
            cnt = 0
            
            for j in range(2,i):
                if i % j == 0:
                    cnt = cnt + 1
                    break
                    
            if cnt == 0:
                #?´???°
                prime_cnt = prime_cnt + 1
                

        print(str(prime_cnt))
    except:
        break
    

Fixed submission:
#init
max_num = 1000000
is_prime_num = [True for i in range (max_num+1)]

#0, 1 --- not prime number
is_prime_num[0] = False
is_prime_num[1] = False
end = int(max_num ** .5)

for i in range(2, end+1):
    if is_prime_num[i]:
        for j in range(i*i, max_num+1, i):
            is_prime_num[j] = False


while True:
    try:
        n = int(input())
        prime_cnt = 0
        for i in range(1, n+1):
            if is_prime_num[i]:
                prime_cnt = prime_cnt + 1
                   
   
        print(str(prime_cnt))
    except:
        break

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

def is_prime_num(in_num):
    cnt = 0
    if in_num == 2:
        return True
    elif in_num <= 1:
        return False
    elif in_num % 2 == 0:
        return False
    else:
        max_num = int(math.sqrt(in_num))
        for j in range(3, in_num, 2):
            if in_num % j == 0:
                cnt = cnt + 1
                break
                    
        if cnt == 0:
            #?´???°
            return True
        else:
            return False


while True:
    try:
        n = int(input())
        prime_cnt = 0

        for i in range(2, n+1):
            if is_prime_num(i):
                #?´???°
                prime_cnt = prime_cnt + 1
                

        print(str(prime_cnt))
    except:
        break
    

Fixed submission:
#init
max_num = 1000000
is_prime_num = [True for i in range (max_num+1)]

#0, 1 --- not prime number
is_prime_num[0] = False
is_prime_num[1] = False
end = int(max_num ** .5)

for i in range(2, end+1):
    if is_prime_num[i]:
        for j in range(i*i, max_num+1, i):
            is_prime_num[j] = False


while True:
    try:
        n = int(input())
        prime_cnt = 0
        for i in range(1, n+1):
            if is_prime_num[i]:
                prime_cnt = prime_cnt + 1
                   
   
        print(str(prime_cnt))
    except:
        break

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

def is_prime_num(in_num):
    cnt = 0
    if in_num == 2:
        return True
    elif in_num <= 1:
        return False
    elif in_num % 2 == 0:
        return False
    else:
        max_num = int(math.sqrt(in_num)+1)
        for j in range(3, max_num, 2):
            if in_num % j == 0:
                cnt = cnt + 1
                break
                    
        if cnt == 0:
            #?´???°
            return True
        else:
            return False

while True:
    try:
        n = int(input())
        prime_cnt = 0

        for i in range(2, n+1):
            if is_prime_num(i):
                #?´???°
                prime_cnt = prime_cnt + 1
                

        print(str(prime_cnt))
    except:
        break
    

Fixed submission:
#init
max_num = 1000000
is_prime_num = [True for i in range (max_num+1)]

#0, 1 --- not prime number
is_prime_num[0] = False
is_prime_num[1] = False
end = int(max_num ** .5)

for i in range(2, end+1):
    if is_prime_num[i]:
        for j in range(i*i, max_num+1, i):
            is_prime_num[j] = False


while True:
    try:
        n = int(input())
        prime_cnt = 0
        for i in range(1, n+1):
            if is_prime_num[i]:
                prime_cnt = prime_cnt + 1
                   
   
        print(str(prime_cnt))
    except:
        break

Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8
# Here your code !
import math
 
def is_prime_num(in_num):
    cnt = 0
    if in_num == 2:
        return True
    elif in_num <= 1:
        return False
    elif in_num % 2 == 0:
        return False
    else:
        if pow(2, in_num-1, in_num) == 1:
        
            max_num = int(math.sqrt(in_num)+1)
            for j in range(3, max_num, 2):
                if in_num % j == 0:
                    cnt = cnt + 1
                    break
                         
            if cnt == 0:
                #??´????°
                return True
            else:
                return False
        else:
            return False

while True:
    try:
        n = int(input())
        prime_cnt = 0
 
        for i in range(2, n+1):
            if is_prime_num(i):
                #??´????°
                prime_cnt = prime_cnt + 1
                 
 
        print(str(prime_cnt))
    except:
        break
    

Fixed submission:
#init
max_num = 1000000
is_prime_num = [True for i in range (max_num+1)]

#0, 1 --- not prime number
is_prime_num[0] = False
is_prime_num[1] = False
end = int(max_num ** .5)

for i in range(2, end+1):
    if is_prime_num[i]:
        for j in range(i*i, max_num+1, i):
            is_prime_num[j] = False


while True:
    try:
        n = int(input())
        prime_cnt = 0
        for i in range(1, n+1):
            if is_prime_num[i]:
                prime_cnt = prime_cnt + 1
                   
   
        print(str(prime_cnt))
    except:
        break

Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8
# Here your code !
import math
 
def is_prime_num(in_num):
    cnt = 0
    if in_num == 2:
        return True
    elif in_num <= 1:
        return False
    elif in_num % 2 == 0:
        return False
    else:
        if pow(2, in_num-1, in_num) == 1:
            max_num = int(math.sqrt(in_num)+1)
            for j in range(3, max_num, 2):
                if in_num % j == 0:
                    cnt = cnt + 1
                    break
                         
            if cnt == 0:
                #??´????°
                return True
            else:
               return False
        else:
            return False

while True:
    try:
        n = int(input())
        prime_cnt = 0
        if n >= 2:
            #?????????2???????????????
            prime_cnt = prime_cnt + 1

        for i in range(3, n+1, 2):
            if is_prime_num(i):
                prime_cnt = prime_cnt + 1
                 
 
        print(str(prime_cnt))
    except:
        break
    

Fixed submission:
#init
max_num = 1000000
is_prime_num = [True for i in range (max_num+1)]

#0, 1 --- not prime number
is_prime_num[0] = False
is_prime_num[1] = False
end = int(max_num ** .5)

for i in range(2, end+1):
    if is_prime_num[i]:
        for j in range(i*i, max_num+1, i):
            is_prime_num[j] = False


while True:
    try:
        n = int(input())
        prime_cnt = 0
        for i in range(1, n+1):
            if is_prime_num[i]:
                prime_cnt = prime_cnt + 1
                   
   
        print(str(prime_cnt))
    except:
        break

Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8
# Here your code !
import math
  
def is_prime_num(in_num):
    cnt = 0
    if in_num == 2:
        return True
    elif in_num <= 1:
        return False
    elif in_num % 2 == 0:
        return False
    else:
        if pow(2, in_num-1, in_num) == 1:
            return True
        else:
            return False
 
while True:
    try:
        n = int(input())
        prime_cnt = 0
        if n >= 2:
            #?????????2???????????????
            prime_cnt = prime_cnt + 1
 
        for i in range(3, n+1, 2):
            if is_prime_num(i):
                prime_cnt = prime_cnt + 1
                  
  
        print(str(prime_cnt))
    except:
        break
    

Fixed submission:
#init
max_num = 1000000
is_prime_num = [True for i in range (max_num+1)]

#0, 1 --- not prime number
is_prime_num[0] = False
is_prime_num[1] = False
end = int(max_num ** .5)

for i in range(2, end+1):
    if is_prime_num[i]:
        for j in range(i*i, max_num+1, i):
            is_prime_num[j] = False


while True:
    try:
        n = int(input())
        prime_cnt = 0
        for i in range(1, n+1):
            if is_prime_num[i]:
                prime_cnt = prime_cnt + 1
                   
   
        print(str(prime_cnt))
    except:
        break