Buggy python submission (verdict: Runtime Error):
def isprime(num):
    if num==1:return False
    if num==2:return True
    for i in range(int(num/2)):
        if num%(i+2)==0:
            return False
        else:continue
    return True
    
def ct(num):
    count=0
    for i in range(num):
        if isprime(i+1):count+=1
    return count

def yak(num):
    if isprime(num):return [1,num]
    if num==1: return[1]
    for i in range(int(num/2)):
        if num%(i+2)==0:
            ret=yak(i+2)+yak(num/(i+2))
            ret.remove(1)
            return sorted([int(i) for i in ret])
    
        
while True:
    try:raw=[float(i) for i in input().split(" ")]
    except:break
    a=raw[0]
    print(str(ct(a)))

Fixed submission:

import math

m=999999
s=int(math.sqrt(m)+1)
li=[0]*m
li[0]=1
for i in range(1,s):
    if li[i]==0:
        li[i*2+1::i+1]=[1 for e in range(len(li[i*2+1::i+1]))]
while True:
    try:n=int(input())
    except:break
    print(len([i for i in li[:n:] if i==0]))

Buggy python submission (verdict: Time Limit Exceeded):
def isprime(num):
    if num==1:return False
    if num==2:return True
    for i in range(int(num/2)):
        if num%(i+2)==0:
            return False
        else:continue
    return True
    
def ct(num):
    count=0
    for i in range(num):
        if isprime(i+1):count+=1
    return count

def yak(num):
    if isprime(num):return [1,num]
    if num==1: return[1]
    for i in range(int(num/2)):
        if num%(i+2)==0:
            ret=yak(i+2)+yak(num/(i+2))
            ret.remove(1)
            return sorted([int(i) for i in ret])
    
        
while True:
    try:raw=[int(i) for i in input().split(" ")]
    except:break
    a=raw[0]
    print(str(ct(a)))

Fixed submission:

import math

m=999999
s=int(math.sqrt(m)+1)
li=[0]*m
li[0]=1
for i in range(1,s):
    if li[i]==0:
        li[i*2+1::i+1]=[1 for e in range(len(li[i*2+1::i+1]))]
while True:
    try:n=int(input())
    except:break
    print(len([i for i in li[:n:] if i==0]))

Buggy python submission (verdict: Time Limit Exceeded):
def ct(num):
    primel=[2]
    for i in range(num):
        n=i+1
        if i==0 or i==1:continue 
        for e in primel:
            if n%e==0:break
        else:primel.append(n)
    return len(primel)        
    
while True:
    try:raw=[int(i) for i in input().split(" ")]
    except:break
    a=raw[0]
    print(str(ct(a)))

Fixed submission:

import math

m=999999
s=int(math.sqrt(m)+1)
li=[0]*m
li[0]=1
for i in range(1,s):
    if li[i]==0:
        li[i*2+1::i+1]=[1 for e in range(len(li[i*2+1::i+1]))]
while True:
    try:n=int(input())
    except:break
    print(len([i for i in li[:n:] if i==0]))

Buggy python submission (verdict: Time Limit Exceeded):
def ct(num):
    primel=[2]
    for i in range(2,num+1): 
        for e in primel:
            if i%e==0:break
        else:primel.append(i)
    return len(primel)        
    
while True:
    try:raw=[int(i) for i in input().split(" ")]
    except:break
    a=raw[0]
    print(str(ct(a)))

Fixed submission:

import math

m=999999
s=int(math.sqrt(m)+1)
li=[0]*m
li[0]=1
for i in range(1,s):
    if li[i]==0:
        li[i*2+1::i+1]=[1 for e in range(len(li[i*2+1::i+1]))]
while True:
    try:n=int(input())
    except:break
    print(len([i for i in li[:n:] if i==0]))

Buggy python submission (verdict: Time Limit Exceeded):
def kqpurge(num):
    k=0
    while num%2==0:
        num=num/2
        k+=1
    return k,int(num)

def miller_l(num):
    k,q=kqpurge(num-1)
    tnum=0
    if num==1:return False
    if num in [2,3,5,7]:return True
    for i in [2,3,5,7]:
        for e in range(k+1):
            if e==0:
                if i**q%num==1:
                    tnum+=1
                    break
                elif i**q%num==num-1:
                    tnum+=1
                    break
            else:
                temp=i**((2**e)*q)
                if temp%num==(num-1):
                    tnum=tnum+1
                    break
                elif temp%num==1:
                    break
    if tnum==4:
        return True
    else:
        return False
        
while True:
    try:n=int(input())
    except:break
    count=0
    for i in range(2,n+1):
        if miller_l(i):
            count+=1
    print(count)

Fixed submission:

import math

m=999999
s=int(math.sqrt(m)+1)
li=[0]*m
li[0]=1
for i in range(1,s):
    if li[i]==0:
        li[i*2+1::i+1]=[1 for e in range(len(li[i*2+1::i+1]))]
while True:
    try:n=int(input())
    except:break
    print(len([i for i in li[:n:] if i==0]))

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

m=999999
l=[False]*m
l[1]=True
for i in range(3,m+1):
    if i%2==0:continue
    for e in range(2,int(math.sqrt(i)+1)):
        if i%e==0:
            break
    else:
        l[i-1]=True
    
while True:
    try:n=int(input())
    except:break
    print(len([i for i in l[:n:] if i]))
    

Fixed submission:

import math

m=999999
s=int(math.sqrt(m)+1)
li=[0]*m
li[0]=1
for i in range(1,s):
    if li[i]==0:
        li[i*2+1::i+1]=[1 for e in range(len(li[i*2+1::i+1]))]
while True:
    try:n=int(input())
    except:break
    print(len([i for i in li[:n:] if i==0]))

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

m=999999
l=[False]*m
l[1]=True
l[2]=True
for i in range(5,m+1):
    if i%2==0 or i%3==0:continue
    for e in range(2,int(math.sqrt(i)+1)):
        if i%e==0:
            break
    else:
        l[i-1]=True
    
while True:
    try:n=int(input())
    except:break
    print(len([i for i in l[:n:] if i]))

Fixed submission:

import math

m=999999
s=int(math.sqrt(m)+1)
li=[0]*m
li[0]=1
for i in range(1,s):
    if li[i]==0:
        li[i*2+1::i+1]=[1 for e in range(len(li[i*2+1::i+1]))]
while True:
    try:n=int(input())
    except:break
    print(len([i for i in li[:n:] if i==0]))