class PrimeChecker:



    def __init__(self):

        self.primes = [2,3]



    def isPrime(self, n):

        if n in self.primes:

            return True

        else:

            for i in self.primes:

                if n % i == 0:

                    return False



        i = 5

        w = 2



        while i * i <= n:

            if n % i == 0:

                return False



            i += w

            w = 6 - w



        self.primes.append(n)



        return True



primeChecker = PrimeChecker()

count = 0

N = int(eval(input()))

for _ in range(N):

    if primeChecker.isPrime((int(eval(input())))):

        count += 1

print(count)

        

class PrimeChecker:

 

    def __init__(self):

        self.primes = [2,3,5]

 

    def isPrime(self, n):

        if n in self.primes:

            return True

        elif n < self.primes[-1]:

            return False

        else:

            for i in self.primes:

                if n % i == 0:

                    return False

 

        i = self.primes[-1]

        w = 2 if i % 6 == 5 else 4

 

        while i * i <= n:

            if self.isPrime(i):

                self.primes.append(i) 

                if n % i == 0:

                    return False

 

            i += w

            w = 6 - w

 

        return True

 

primeChecker = PrimeChecker()

count = 0

N = int(eval(input()))

for _ in range(N):

    if primeChecker.isPrime((int(eval(input())))):

        count += 1

print(count)

        

class PrimeChecker:
    def __init__(self):
        self.primes = [2, 3]

    def isPrime(self, n):
        if n in self.primes:
            return True
        else:
            for i in self.primes:
                if n % i == 0:
                    return False
        i = 5
        w = 2
        while i * i <= n:
            if n % i == 0:
                return False
            i += w
            w = 6 - w
        self.primes.append(n)
        return True


primeChecker = PrimeChecker()
count = 0
N = int(eval(input()))
for _ in range(N):
    if primeChecker.isPrime((int(eval(input())))):
        count += 1
print(count)

class PrimeChecker:
    def __init__(self):
        self.primes = [2, 3, 5]

    def isPrime(self, n):
        if n in self.primes:
            return True
        elif n < self.primes[-1]:
            return False
        else:
            for i in self.primes:
                if n % i == 0:
                    return False
        i = self.primes[-1]
        w = 2 if i % 6 == 5 else 4
        while i * i <= n:
            if self.isPrime(i):
                self.primes.append(i)
                if n % i == 0:
                    return False
            i += w
            w = 6 - w
        return True


primeChecker = PrimeChecker()
count = 0
N = int(eval(input()))
for _ in range(N):
    if primeChecker.isPrime((int(eval(input())))):
        count += 1
print(count)

-        self.primes = [2, 3] +        self.primes = [2, 3, 5] +        elif n < self.primes[-1]: +            return False -        i = 5 -        w = 2 +        i = self.primes[-1] +        w = 2 if i % 6 == 5 else 4 -            if n % i == 0: -                return False +            if self.isPrime(i): +                self.primes.append(i) +                if n % i == 0: +                    return False -        self.primes.append(n)