import sys
import math

def str_input():
    S = raw_input()
    if S[len(S)-1] == "\r":
        return S[:len(S)-1]
    return S

def float_to_str(num):
    return str("{:.10f}".format(num))

def list_input(tp):
    return map(tp, str_input().split())

# # # # # # # # # # # # # # # # # # # # # # # # #

n = input()

cnt = 0

for i in xrange(n):
    m = input()
    for j in xrange(2, int(math.sqrt(m))+1):
        if m % j == 0:
            break
    else:
        cnt += 1

print cnt import sys sys import math math def str_input():
    S = raw_input()
    if S[len(S)-1] == "\r":
        return S[:len(S)-1]
    return S str_input S = raw_input() S raw_input() raw_input if S[len(S)-1] == "\r":
        return S[:len(S)-1]
     S[len(S)-1] == "\r" S[len(S)-1] S len(S)-1 len(S) len S 1 "\r" return S[:len(S)-1] S[:len(S)-1] S :len(S)-1 len(S)-1 len(S) len S 1 return S S def float_to_str(num):
    return str("{:.10f}".format(num)) float_to_str return str("{:.10f}".format(num)) str("{:.10f}".format(num)) str "{:.10f}".format(num) "{:.10f}".format "{:.10f}" format num num num def list_input(tp):
    return map(tp, str_input().split())

# # # # # # # # # # # # # # # # # # # # # # # # # list_input return map(tp, str_input().split()) map(tp, str_input().split()) map tp str_input().split() ().split () str_input split tp tp n = input() n input() input cnt = 0 cnt 0 for i in xrange(n):
    m = input()
    for j in xrange(2, int(math.sqrt(m))+1):
        if m % j == 0:
            break
    else:
        cnt += 1 i xrange(n) xrange n m = input() m input() input for j in xrange(2, int(math.sqrt(m))+1):
        if m % j == 0:
            break
    else:
        cnt += 1 j xrange(2, int(math.sqrt(m))+1) xrange 2 int(math.sqrt(m))+1 int(math.sqrt(m)) int math.sqrt(m) math.sqrt math sqrt m 1 if m % j == 0:
            break
     m % j == 0 m % j m j 0 break cnt += 1 cnt 1 print m = input() input() m def str_input():
    S = raw_input()
    if S[len(S)-1] == "\r":
        return S[:len(S)-1]
    return S def str_input():
    S = raw_input()
    if S[len(S)-1] == "\r":
        return S[:len(S)-1]
    return S str_input def list_input(tp):
    return map(tp, str_input().split())

# # # # # # # # # # # # # # # # # # # # # # # # # def list_input(tp):
    return map(tp, str_input().split())

# # # # # # # # # # # # # # # # # # # # # # # # # list_input def float_to_str(num):
    return str("{:.10f}".format(num)) def float_to_str(num):
    return str("{:.10f}".format(num)) float_to_str n = input() input() n cnt += 1 1 cnt cnt = 0 0 cnt
import sys
import math

def str_input():
    S = raw_input()
    if S[len(S)-1] == "\r":
        return S[:len(S)-1]
    return S

def float_to_str(num):
    return str("{:.10f}".format(num))

def list_input(tp):
    return map(tp, str_input().split())

# # # # # # # # # # # # # # # # # # # # # # # # #

n = input()

cnt = 0

for i in xrange(n):
    m = input()
    for j in xrange(2, int(math.sqrt(m))+1):
        if m % j == 0:
            break
    else:
        cnt += 1

print cnt