import math
def is_prime(n):
    if n % 2 == 0 and n > 2: 
        return False
    return all(n % i for i in range(3, int(math.sqrt(n)) + 1, 2))
                      
while True:
    try:
        n = int(raw_input())
        total = 0
        for k in range(n):
            if is_prime(int(raw_input())):
                total +=1
        print total
    except EOFError:
        break     import math math def is_prime(n):
    if n % 2 == 0 and n > 2: 
        return False
    return all(n % i for i in range(3, int(math.sqrt(n)) + 1, 2))
                       is_prime if n % 2 == 0 and n > 2: 
        return False
     n % 2 == 0 and n > 2 n % 2 == 0 n % 2 n 2 0 n > 2 n 2 return False False return all(n % i for i in range(3, int(math.sqrt(n)) + 1, 2)) all(n % i for i in range(3, int(math.sqrt(n)) + 1, 2)) all n % i n i n n while True:
    try:
        n = int(raw_input())
        total = 0
        for k in range(n):
            if is_prime(int(raw_input())):
                total +=1
        print total
    except EOFError:
        break     True try:
        n = int(raw_input())
        total = 0
        for k in range(n):
            if is_prime(int(raw_input())):
                total +=1
        print total
    except EOFError:
        break     except EOFError:
        break     break n = int(raw_input()) n int(raw_input()) int raw_input() raw_input total = 0 total 0 for k in range(n):
            if is_prime(int(raw_input())):
                total +=1
         k range(n) range n if is_prime(int(raw_input())):
                total +=1
         is_prime(int(raw_input())) is_prime int(raw_input()) int raw_input() raw_input total +=1 total 1 print n = int(raw_input()) int(raw_input()) n total +=1 1 total total = 0 0 total def is_prime(n):
    if n % 2 == 0 and n > 2: 
        return False
    return all(n % i for i in range(3, int(math.sqrt(n)) + 1, 2))
                       def is_prime(n):
    if n % 2 == 0 and n > 2: 
        return False
    return all(n % i for i in range(3, int(math.sqrt(n)) + 1, 2))
                       is_prime
import math
def is_prime(n):
    if n % 2 == 0 and n > 2: 
        return False
    return all(n % i for i in range(3, int(math.sqrt(n)) + 1, 2))
                      
while True:
    try:
        n = int(raw_input())
        total = 0
        for k in range(n):
            if is_prime(int(raw_input())):
                total +=1
        print total
    except EOFError:
        break    