Buggy python submission (verdict: Runtime Error):
from math import sqrt
def isprime(farm, prime):
	
	first = min(farm)
	prime.append(first)
	maxfarm = max(farm)
	dellst = range(first, maxfarm+1, first)
	farm = set(farm - set(dellst))
	if len(farm) > 0 and sqrt(maxfarm) > first:
		return isprime(farm, prime)
	else:
		return prime.extend(farm)

n = int(input())
inlst = []
for i in range(n):
	inlst.append(int(input()))
	
farm = set(range(2, max(inlst)+1, 1))
prime = [1]

if len(farm) > 0:
	isprime(farm, prime)
	
out = list(set(inlst) & set(prime))
print(len(out))

Fixed submission:
from math import sqrt
def isprime(inlst, chk, sq):
	for i in range(3, sq, 2):
		inlst = [x for x in inlst if x%i > 0 or x == i]
		i += 2
	return inlst
n = int(input())
inlst = [input() for i in range(n)]
inlst = [int(i) for i in inlst]
inlst = [x for x in inlst if x%2 > 0 or x == 2]
inlst = isprime(inlst, 3, int(sqrt(max(inlst))) + 1)
print(len(inlst))

Buggy python submission (verdict: Runtime Error):
from math import sqrt
def isprime(farm, prime):
	
	first = min(farm)
	prime.append(first)
	maxfarm = max(farm)
	dellst = range(first, maxfarm+1, first)
	farm = set(farm - set(dellst))
	if len(farm) > 0 and sqrt(maxfarm) > first:
		return isprime(farm, prime)
	else:
		return prime.extend(farm)

n = int(input())
inlst = []
for i in range(n):
	inlst.append(int(input()))
	
farm = set(range(3, max(inlst)+1, 2))
prime = [1,2]

if len(farm) > 0:
	isprime(farm, prime)
	
out = list(set(inlst) & set(prime))
print(len(out))

Fixed submission:
from math import sqrt
def isprime(inlst, chk, sq):
	for i in range(3, sq, 2):
		inlst = [x for x in inlst if x%i > 0 or x == i]
		i += 2
	return inlst
n = int(input())
inlst = [input() for i in range(n)]
inlst = [int(i) for i in inlst]
inlst = [x for x in inlst if x%2 > 0 or x == 2]
inlst = isprime(inlst, 3, int(sqrt(max(inlst))) + 1)
print(len(inlst))

Buggy python submission (verdict: Runtime Error):
from math import sqrt
def isprime(inlst, i, sq):
	inlst = list(filter(lambda x: x % i is not 0 or x is i, inlst))
	if sq >= i:
		return isprime(inlst, i +2, sq)
	else:
		return inlst

n = int(input())
inlst = []
twonum = 0
for i in range(n):
	inlst.append(int(input()))
	if inlst[i] == 2:
			twonum += 1
	
inlst = list(filter(lambda x: x % 2 is not 0, inlst))
i = 3
maxin = max(inlst)
if len(inlst) > 0:
	inlst = isprime(inlst, i, int(sqrt(maxin)) + 1)
print(len(inlst) + twonum)

Fixed submission:
from math import sqrt
def isprime(inlst, chk, sq):
	for i in range(3, sq, 2):
		inlst = [x for x in inlst if x%i > 0 or x == i]
		i += 2
	return inlst
n = int(input())
inlst = [input() for i in range(n)]
inlst = [int(i) for i in inlst]
inlst = [x for x in inlst if x%2 > 0 or x == 2]
inlst = isprime(inlst, 3, int(sqrt(max(inlst))) + 1)
print(len(inlst))

Buggy python submission (verdict: Runtime Error):
from math import sqrt
def isprime(inlst, i, sq):
	inlst = list(filter(lambda x: x % i is not 0 or x is i, inlst))
	if sq >= i:
		return isprime(inlst, i +2, sq)
	else:
		return inlst

n = int(input())
inlst = []
twonum = 0
for i in range(n):
	inlst.append(int(input()))
	
inlst = list(filter(lambda x: x % 2 is not 0 or x is 2, inlst))
i = 3
maxin = max(inlst)
if len(inlst) > 0:
	inlst = isprime(inlst, i, int(sqrt(maxin)) + 1)
print(len(inlst))

Fixed submission:
from math import sqrt
def isprime(inlst, chk, sq):
	for i in range(3, sq, 2):
		inlst = [x for x in inlst if x%i > 0 or x == i]
		i += 2
	return inlst
n = int(input())
inlst = [input() for i in range(n)]
inlst = [int(i) for i in inlst]
inlst = [x for x in inlst if x%2 > 0 or x == 2]
inlst = isprime(inlst, 3, int(sqrt(max(inlst))) + 1)
print(len(inlst))

Buggy python submission (verdict: Runtime Error):
from math import sqrt
def isprime(inlst, i, sq):
    inlst = [x for x in inlst if x%i > 0 or x == i]
    if sq >= i:
        return isprime(inlst, i +2, sq)
    else:
        return inlst
 
n = int(input())
inlst = []
for i in range(n):
    inlst.append(int(input()))
inlst = [x for x in inlst if x%2 > 0 or x == 2]
i = 3
maxin = max(inlst)
if len(inlst) > 0:
    inlst = isprime(inlst, i, int(sqrt(maxin)) + 1)
print(len(inlst))

Fixed submission:
from math import sqrt
def isprime(inlst, chk, sq):
	for i in range(3, sq, 2):
		inlst = [x for x in inlst if x%i > 0 or x == i]
		i += 2
	return inlst
n = int(input())
inlst = [input() for i in range(n)]
inlst = [int(i) for i in inlst]
inlst = [x for x in inlst if x%2 > 0 or x == 2]
inlst = isprime(inlst, 3, int(sqrt(max(inlst))) + 1)
print(len(inlst))

Buggy python submission (verdict: Time Limit Exceeded):
def is_prime(x):

    if x == 2 : return True

    for i in range(2, x):
        if x % i == 0:
            return False

    return True


n = int(input())
res = 0

for _ in range(n):
    x = int(input())
    if is_prime(x): res += 1

print(res)

Fixed submission:
import math
def is_prime(n):
    if n in [2, 3, 5]:
        return True
    for i in range(2, int(math.sqrt(n))+1):
        if n % i == 0:
            return False
        
    return True

n = int(input())
nums = [int(input()) for i in range(n)]
res = len([i for i in nums if is_prime(i)])
print(res)