import math



def isPrime(x) :

    if x == 2 :

        return True



    if x < 2 or x % 2 == 0 :

        return False



    i = 3

    while i <= math.sqrt(x) :

        if x % i == 0 :

            return False

        i += 2



    return True





def main() :

    n = int(eval(input()))

    nums = []

    for i in range(n) :

        x = int(eval(input()))

        nums.append(x)



    count = 0

    for num in nums :

        if isPrime(num) :

            count += 1



    print(count)





if __name__ == '__main__' :

    main()
def is_prime(x) :

    if x == 2 :

        return True

    if x < 2 or x % 2 == 0 :

        return False



    return pow(2, x-1, x) == 1



def main() :

    n = int(eval(input()))

    nums = []

    for _ in range(n) :

        x = int(eval(input()))

        nums.append(x)



    count = 0

    for num in nums :

        if is_prime(num) :

            count += 1



    print(count)



if __name__ == '__main__' :

    main()
import math


def isPrime(x):
    if x == 2:
        return True
    if x < 2 or x % 2 == 0:
        return False
    i = 3
    while i <= math.sqrt(x):
        if x % i == 0:
            return False
        i += 2
    return True


def main():
    n = int(eval(input()))
    nums = []
    for i in range(n):
        x = int(eval(input()))
        nums.append(x)
    count = 0
    for num in nums:
        if isPrime(num):
            count += 1
    print(count)


if __name__ == "__main__":
    main()

def is_prime(x):
    if x == 2:
        return True
    if x < 2 or x % 2 == 0:
        return False
    return pow(2, x - 1, x) == 1


def main():
    n = int(eval(input()))
    nums = []
    for _ in range(n):
        x = int(eval(input()))
        nums.append(x)
    count = 0
    for num in nums:
        if is_prime(num):
            count += 1
    print(count)


if __name__ == "__main__":
    main()

-import math - - -def isPrime(x): +def is_prime(x): -    i = 3 -    while i <= math.sqrt(x): -        if x % i == 0: -            return False -        i += 2 -    return True +    return pow(2, x - 1, x) == 1 -    for i in range(n): +    for _ in range(n): -        if isPrime(num): +        if is_prime(num):