import math
def isPrime(n):
    if n <= 1:
        return False
    elif n < 4:
        return True
    elif n % 2 == 0:
        return False
    elif n < 9:
        return True
    elif n % 3 == 0:
        return False
    else:
        i = 5
        while i <= math.sqrt(n):
            if n % i == 0:
                return False
            if n % (i + 2) == 0:
                return False
            i+=6
    return True
            
N = int(raw_input())
D = [int(raw_input()) for i in xrange(N)]
count = 0
for i in D:
    if isPrime(i) == True:
        count += 1
print count import math math def isPrime(n):
    if n <= 1:
        return False
    elif n < 4:
        return True
    elif n % 2 == 0:
        return False
    elif n < 9:
        return True
    elif n % 3 == 0:
        return False
    else:
        i = 5
        while i <= math.sqrt(n):
            if n % i == 0:
                return False
            if n % (i + 2) == 0:
                return False
            i+=6
    return True
             isPrime if n <= 1:
        return False
    elif n < 4:
        return True
    elif n % 2 == 0:
        return False
    elif n < 9:
        return True
    elif n % 3 == 0:
        return False
    else:
        i = 5
        while i <= math.sqrt(n):
            if n % i == 0:
                return False
            if n % (i + 2) == 0:
                return False
            i+=6
     n <= 1 n 1 return False False elif n < 4:
        return True
     n < 4 n 4 return True True elif n % 2 == 0:
        return False
     n % 2 == 0 n % 2 n 2 0 return False False elif n < 9:
        return True
     n < 9 n 9 return True True elif n % 3 == 0:
        return False
     n % 3 == 0 n % 3 n 3 0 return False False i = 5 i 5 while i <= math.sqrt(n):
            if n % i == 0:
                return False
            if n % (i + 2) == 0:
                return False
            i+=6
     i <= math.sqrt(n) i math.sqrt(n) math.sqrt math sqrt n if n % i == 0:
                return False
             n % i == 0 n % i n i 0 return False False if n % (i + 2) == 0:
                return False
             n % (i + 2) == 0 n % (i + 2) n i + 2 i 2 0 return False False i+=6 i 6 return True True n n N = int(raw_input()) N int(raw_input()) int raw_input() raw_input int(raw_input()) for i in xrange(N) for i in xrange(N) i xrange(N) xrange N for i in xrange(N) int(raw_input()) int raw_input() raw_input D = [int(raw_input()) for i in xrange(N)] D [int(raw_input()) for i in xrange(N)] count = 0 count 0 for i in D:
    if isPrime(i) == True:
        count += 1 i D if isPrime(i) == True:
        count += 1 isPrime(i) == True isPrime(i) isPrime i True count += 1 count 1 print D = [int(raw_input()) for i in xrange(N)] [int(raw_input()) for i in xrange(N)] D N = int(raw_input()) int(raw_input()) N count = 0 0 count count += 1 1 count def isPrime(n):
    if n <= 1:
        return False
    elif n < 4:
        return True
    elif n % 2 == 0:
        return False
    elif n < 9:
        return True
    elif n % 3 == 0:
        return False
    else:
        i = 5
        while i <= math.sqrt(n):
            if n % i == 0:
                return False
            if n % (i + 2) == 0:
                return False
            i+=6
    return True
             def isPrime(n):
    if n <= 1:
        return False
    elif n < 4:
        return True
    elif n % 2 == 0:
        return False
    elif n < 9:
        return True
    elif n % 3 == 0:
        return False
    else:
        i = 5
        while i <= math.sqrt(n):
            if n % i == 0:
                return False
            if n % (i + 2) == 0:
                return False
            i+=6
    return True
             isPrime
import math
def isPrime(n):
    if n <= 1:
        return False
    elif n < 4:
        return True
    elif n % 2 == 0:
        return False
    elif n < 9:
        return True
    elif n % 3 == 0:
        return False
    else:
        i = 5
        while i <= math.sqrt(n):
            if n % i == 0:
                return False
            if n % (i + 2) == 0:
                return False
            i+=6
    return True
            
N = int(raw_input())
D = [int(raw_input()) for i in xrange(N)]
count = 0
for i in D:
    if isPrime(i) == True:
        count += 1
print count