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

def count_prime(x):
    temp = 0
    for i in range(2,x+1):
        for j in range(2,i+1):
            if(j == i):
                temp += 1
            elif(i % j == 0):
                break
    return temp

l = []
for input in sys.stdin:
    l.append(input)
print l
for input in l:
    print count_prime(int(input))


Fixed submission:
import sys

def is_prime(x):
    if(x <= 3 and x > 1):
        return 1
    elif(x == 5):
        return 1
    elif(x % 2 == 0 or x < 2):
        return 0
    a = 3
    while(a * a <= x):
        if(x % a == 0):
            return 0
        a += 2
    return 1

def generate_prime(x):
    list = []
    list.append(2)
    for i in range(3,x+1,2):
        if(is_prime(i) == 1):
            list.append(i)
    return list

def count_list(x,list):
    count = 0
    for i in range(0,len(list)):
        if(list[i] > x):
            break
        elif(list[i] <= x):
            count += 1
    return count

l = []
for input in sys.stdin:
    l.append(int(input))

prime = generate_prime(max(l))
for i in range(0,len(l)):
    print count_list(l[i],prime)

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

def count_prime(x):
    temp = 0
    if(x > 2):
        temp += 1
    for i in range(3,x+1,2):
        if(i % 2 == 0):
            continue
        for j in range(3,i+1,2):
            if(j == i):
                temp += 1
            elif(i % j == 0):
                break
    return temp

l = []
for input in sys.stdin:
    l.append(input)
print l
for input in l:
    print count_prime(int(input))


Fixed submission:
import sys

def is_prime(x):
    if(x <= 3 and x > 1):
        return 1
    elif(x == 5):
        return 1
    elif(x % 2 == 0 or x < 2):
        return 0
    a = 3
    while(a * a <= x):
        if(x % a == 0):
            return 0
        a += 2
    return 1

def generate_prime(x):
    list = []
    list.append(2)
    for i in range(3,x+1,2):
        if(is_prime(i) == 1):
            list.append(i)
    return list

def count_list(x,list):
    count = 0
    for i in range(0,len(list)):
        if(list[i] > x):
            break
        elif(list[i] <= x):
            count += 1
    return count

l = []
for input in sys.stdin:
    l.append(int(input))

prime = generate_prime(max(l))
for i in range(0,len(l)):
    print count_list(l[i],prime)

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

def is_prime(n):
        if n <= 1:
            return 0
        elif n <= 3:
            return 1
        elif (n % 2 == 0 or n % 3 == 0):
            return 0
        i = 5
        while ((i * i) <= n):
            if (n % i == 0 or n % (i + 2) == 0):
                return 0
            i += 6
        return 1

def count_prime(x):
    temp = 0
    if(x > 2):
        temp += 1
    for i in range(3,x+1,2):
        if(is_prime(i) == 1):
            temp += 1
    return temp

l = []
for input in sys.stdin:
    l.append(input)
print l
for input in l:
    print count_prime(int(input))


Fixed submission:
import sys

def is_prime(x):
    if(x <= 3 and x > 1):
        return 1
    elif(x == 5):
        return 1
    elif(x % 2 == 0 or x < 2):
        return 0
    a = 3
    while(a * a <= x):
        if(x % a == 0):
            return 0
        a += 2
    return 1

def generate_prime(x):
    list = []
    list.append(2)
    for i in range(3,x+1,2):
        if(is_prime(i) == 1):
            list.append(i)
    return list

def count_list(x,list):
    count = 0
    for i in range(0,len(list)):
        if(list[i] > x):
            break
        elif(list[i] <= x):
            count += 1
    return count

l = []
for input in sys.stdin:
    l.append(int(input))

prime = generate_prime(max(l))
for i in range(0,len(l)):
    print count_list(l[i],prime)