def maybe_prime(d,s,n):
    for a in (2,3,5,7):
        p = False
        x = pow(a,d,n)
        if x==1 or x==n-1:
            continue
        for i in range(1,s):
            x = x*x%n
            if x==1: return False
            elif x == n-1:
                p = True
                break
        if not p: return False
    return True

def is_prime(n):
    if n in (2,3,5,7): return True
    elif n%2==0: return False
    else:
        d,s = n-1, 0
        while not d%2:
            d,s = d>>1,s+1
        return maybe_prime(d,s,n)
cnt = 0
n = int(input())
for i in range(n):
  n = int(input())
  if is_prime(n): cnt+=1

print(cnt) def maybe_prime(d,s,n):
    for a in (2,3,5,7):
        p = False
        x = pow(a,d,n)
        if x==1 or x==n-1:
            continue
        for i in range(1,s):
            x = x*x%n
            if x==1: return False
            elif x == n-1:
                p = True
                break
        if not p: return False
    return True maybe_prime for a in (2,3,5,7):
        p = False
        x = pow(a,d,n)
        if x==1 or x==n-1:
            continue
        for i in range(1,s):
            x = x*x%n
            if x==1: return False
            elif x == n-1:
                p = True
                break
        if not p: return False
     a (2,3,5,7) 2 3 5 7 p = False p False x = pow(a,d,n) x pow(a,d,n) pow a d n if x==1 or x==n-1:
            continue
         x==1 or x==n-1 x==1 x 1 x==n-1 x n-1 n 1 continue for i in range(1,s):
            x = x*x%n
            if x==1: return False
            elif x == n-1:
                p = True
                break
         i range(1,s) range 1 s x = x*x%n x x*x%n x*x x x n if x==1: return False
            elif x == n-1:
                p = True
                break
         x==1 x 1 elif x == n-1:
                p = True
                break
         x == n-1 x n-1 n 1 p = True p True break if not p: return False
     not p p return True True d d s s n n def is_prime(n):
    if n in (2,3,5,7): return True
    elif n%2==0: return False
    else:
        d,s = n-1, 0
        while not d%2:
            d,s = d>>1,s+1
        return maybe_prime(d,s,n) is_prime if n in (2,3,5,7): return True
    elif n%2==0: return False
    else:
        d,s = n-1, 0
        while not d%2:
            d,s = d>>1,s+1
        return maybe_prime(d,s,n) n in (2,3,5,7) n (2,3,5,7) 2 3 5 7 elif n%2==0: return False
     n%2==0 n%2 n 2 0 d,s = n-1, 0 d n-1 n 1 s 0 while not d%2:
            d,s = d>>1,s+1
         not d%2 d%2 d 2 d,s = d>>1,s+1 d d>>1 d 1 s s+1 s 1 return maybe_prime(d,s,n) maybe_prime(d,s,n) maybe_prime d s n n n cnt = 0 cnt 0 n = int(input()) n int(input()) int input() input for i in range(n):
  n = int(input())
  if is_prime(n): cnt+=1 i range(n) range n n = int(input()) n int(input()) int input() input if is_prime(n): cnt+ is_prime(n) is_prime n print(cnt) print cnt def maybe_prime(d,s,n):
    for a in (2,3,5,7):
        p = False
        x = pow(a,d,n)
        if x==1 or x==n-1:
            continue
        for i in range(1,s):
            x = x*x%n
            if x==1: return False
            elif x == n-1:
                p = True
                break
        if not p: return False
    return True def maybe_prime(d,s,n):
    for a in (2,3,5,7):
        p = False
        x = pow(a,d,n)
        if x==1 or x==n-1:
            continue
        for i in range(1,s):
            x = x*x%n
            if x==1: return False
            elif x == n-1:
                p = True
                break
        if not p: return False
    return True maybe_prime n = int(input()) int(input()) n def is_prime(n):
    if n in (2,3,5,7): return True
    elif n%2==0: return False
    else:
        d,s = n-1, 0
        while not d%2:
            d,s = d>>1,s+1
        return maybe_prime(d,s,n) def is_prime(n):
    if n in (2,3,5,7): return True
    elif n%2==0: return False
    else:
        d,s = n-1, 0
        while not d%2:
            d,s = d>>1,s+1
        return maybe_prime(d,s,n) is_prime cnt = 0 0 cnt n = int(input()) int(input()) n
def maybe_prime(d,s,n):
    for a in (2,3,5,7):
        p = False
        x = pow(a,d,n)
        if x==1 or x==n-1:
            continue
        for i in range(1,s):
            x = x*x%n
            if x==1: return False
            elif x == n-1:
                p = True
                break
        if not p: return False
    return True

def is_prime(n):
    if n in (2,3,5,7): return True
    elif n%2==0: return False
    else:
        d,s = n-1, 0
        while not d%2:
            d,s = d>>1,s+1
        return maybe_prime(d,s,n)
cnt = 0
n = int(input())
for i in range(n):
  n = int(input())
  if is_prime(n): cnt+=1

print(cnt)