def main():

    n = int(eval(input()))

    count = 0

    for _ in range(n):

        x = int(eval(input()))

        count += isprime(x)

    print(count)



def isprime(x: int):

    if x == 2:

        return True

    if x % 2 == 0:

        return False

    for y in range(3, int(x**0.5)+1, 2):

        if x % y == 0:

            return False

    return True



if __name__ == '__main__':

    main()



def main():

    A = set()

    n_prime = 0

    while True:

        try:

            x = int(eval(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()

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


def isprime(x: int):
    if x == 2:
        return True
    if x % 2 == 0:
        return False
    for y in range(3, int(x**0.5) + 1, 2):
        if x % y == 0:
            return False
    return True


if __name__ == "__main__":
    main()

def main():
    A = set()
    n_prime = 0
    while True:
        try:
            x = int(eval(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()

-    n = int(eval(input())) -    count = 0 -    for _ in range(n): -        x = int(eval(input())) -        count += isprime(x) -    print(count) +    A = set() +    n_prime = 0 +    while True: +        try: +            x = int(eval(input())) +            A.add(x) +        except: +            break +    for x in A: +        n_prime += is_prime(x) +    print(n_prime) -def isprime(x: int): +def is_prime(x): -        return True -    if x % 2 == 0: -        return False -    for y in range(3, int(x**0.5) + 1, 2): -        if x % y == 0: -            return False -    return True +        return 1 +    elif x % 2 == 0: +        return 0 +    else: +        return pow(2, x - 1, x) == 1 -if __name__ == "__main__": -    main() +main()