Buggy python submission (verdict: Time Limit Exceeded):
def main():
    n = int(input())
    primelist = []
    for _ in range(n):
        x = int(input())
        if isprime(x) == 1:
            primelist.append(x)
    print(len(primelist))

def isprime(x: int):    
    yesno = 1
    for y in range(2, x):
        if gcd(x, y) != 1:
            yesno = 0
            break
    return yesno

def gcd(x, y):    
    # x > y となるように並べ替え
    if x < y:
        (x, y) = (y, x)
    return x if y == 0 else gcd(y, x%y)

if __name__ == '__main__':
    main()



Fixed submission:
def main():
    A = set()
    n_prime = 0
    while True:
        try:
            x = int(input())
            A.add(x)
        except:
            break

    for x in A:
        n_prime += is_prime(x)

    print(n_prime)


def is_prime(x):  
    if x == 2:
        return 1
    elif x % 2 == 0:
        return 0
    else:
        return pow(2, x - 1, x) == 1   

main()

Buggy python submission (verdict: Runtime Error):
def main():
    n = int(input())
    primelist = []
    for _ in range(n):
        x = int(input())
        if isprime(x) == 1:
            primelist.append(x)
    print(len(primelist))

def isprime(x: int):    
    if x == 2:
        return 1
    elif x % 2 == 0:
        retrn 0
    else:        
        yesno = 1
        for y in range(3, x, 2):
            # 偶数は最初に除外するので、奇数で割れるかだけ見ていく
            if x % y == 0:
                yesno = 0
                break
    return yesno

if __name__ == '__main__':
    main()



Fixed submission:
def main():
    A = set()
    n_prime = 0
    while True:
        try:
            x = int(input())
            A.add(x)
        except:
            break

    for x in A:
        n_prime += is_prime(x)

    print(n_prime)


def is_prime(x):  
    if x == 2:
        return 1
    elif x % 2 == 0:
        return 0
    else:
        return pow(2, x - 1, x) == 1   

main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    n = int(input())
    primelist = []
    for _ in range(n):
        x = int(input())
        if isprime(x) == 1:
            primelist.append(x)
    print(len(primelist))

def isprime(x: int):    
    if x == 2:
        return 1
    elif x % 2 == 0:
        return 0
    else:        
        yesno = 1
        for y in range(3, x, 2):
            # 偶数は最初に除外するので、奇数で割れるかだけ見ていく
            if x % y == 0:
                yesno = 0
                break
    return yesno

if __name__ == '__main__':
    main()



Fixed submission:
def main():
    A = set()
    n_prime = 0
    while True:
        try:
            x = int(input())
            A.add(x)
        except:
            break

    for x in A:
        n_prime += is_prime(x)

    print(n_prime)


def is_prime(x):  
    if x == 2:
        return 1
    elif x % 2 == 0:
        return 0
    else:
        return pow(2, x - 1, x) == 1   

main()

Buggy python submission (verdict: Time Limit Exceeded):
# とても時間がかかる

def main():
    n = int(input())
    count = 0
    for _ in range(n):
        x = int(input())
        if isprime(x) == 1:
            count += 1
    print(count)

def isprime(x: int):    
    if x == 2:
        return 1
    elif x % 2 == 0:
        return 0
    else:        
        yesno = 1
        for y in range(3, x//2, 2):
            # 偶数は最初に除外するので、奇数で割れるかだけ見ていく
            if x % y == 0:
                yesno = 0
                break
    return yesno

if __name__ == '__main__':
    main()



Fixed submission:
def main():
    A = set()
    n_prime = 0
    while True:
        try:
            x = int(input())
            A.add(x)
        except:
            break

    for x in A:
        n_prime += is_prime(x)

    print(n_prime)


def is_prime(x):  
    if x == 2:
        return 1
    elif x % 2 == 0:
        return 0
    else:
        return pow(2, x - 1, x) == 1   

main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    n = int(input())
    count = 0
    for _ in range(n):
        x = int(input())
        if isprime(x) == 1:
            count += 1
    print(count)

def isprime(x: int):    
    if x == 2:
        return 1
    elif x % 2 == 0:
        return 0
    else:        
        for y in range(3, x, 2):
            # 偶数は最初に除外するので、奇数で割れるかだけ見ていく
            if x % y == 0:
                return 0
    return 1

if __name__ == '__main__':
    main()



Fixed submission:
def main():
    A = set()
    n_prime = 0
    while True:
        try:
            x = int(input())
            A.add(x)
        except:
            break

    for x in A:
        n_prime += is_prime(x)

    print(n_prime)


def is_prime(x):  
    if x == 2:
        return 1
    elif x % 2 == 0:
        return 0
    else:
        return pow(2, x - 1, x) == 1   

main()