import math

p = [2]
    
def isprime(x):
    if x == 2:
        return True
    if x == 3:
        return True
    if max(p) < x**0.5:
        for j in range(max(p), math.floor(x**0.5) + 1):
            if all([j % k != 0 for k in p]):
                p.append(j)
    i = 0
    while i <= len(p)-1:
        if x%p[i] == 0:
            return False
        if p[i] > x**0.5:
            break;
        i += 1
    return True


n = int(input())
res = 0
for i in range(n):
    k = int(input())
    if isprime(k):
        res += 1
print(res) import math math p = [2] p [2] 2 def isprime(x):
    if x == 2:
        return True
    if x == 3:
        return True
    if max(p) < x**0.5:
        for j in range(max(p), math.floor(x**0.5) + 1):
            if all([j % k != 0 for k in p]):
                p.append(j)
    i = 0
    while i <= len(p)-1:
        if x%p[i] == 0:
            return False
        if p[i] > x**0.5:
            break;
        i += 1
    return True isprime if x == 2:
        return True
     x == 2 x 2 return True True if x == 3:
        return True
     x == 3 x 3 return True True if max(p) < x**0.5:
        for j in range(max(p), math.floor(x**0.5) + 1):
            if all([j % k != 0 for k in p]):
                p.append(j)
     max(p) < x**0.5 max(p) max p x**0.5 x 0.5 for j in range(max(p), math.floor(x**0.5) + 1):
            if all([j % k != 0 for k in p]):
                p.append(j)
     j range(max(p), math.floor(x**0.5) + 1) range max(p) max p math.floor(x**0.5) + 1 math.floor(x**0.5) math.floor math floor x**0.5 x 0.5 1 if all([j % k != 0 for k in p]):
                p.append(j)
     all([j % k != 0 for k in p]) all [j % k != 0 for k in p] p.append(j) p.append p append j i = 0 i 0 while i <= len(p)-1:
        if x%p[i] == 0:
            return False
        if p[i] > x**0.5:
            break;
        i += 1
     i <= len(p)-1 i len(p)-1 len(p) len p 1 if x%p[i] == 0:
            return False
         x%p[i] == 0 x%p[i] x p[i] p i 0 return False False if p[i] > x**0.5:
            break;
         p[i] > x**0.5 p[i] p i x**0.5 x 0.5 break i += 1 i 1 return True True x x n = int(input()) n int(input()) int input() input res = 0 res 0 for i in range(n):
    k = int(input())
    if isprime(k):
        res += 1 i range(n) range n k = int(input()) k int(input()) int input() input if isprime(k):
        res += 1 isprime(k) isprime k res += 1 res 1 print(res) print res res = 0 0 res k = int(input()) int(input()) k n = int(input()) int(input()) n res += 1 1 res def isprime(x):
    if x == 2:
        return True
    if x == 3:
        return True
    if max(p) < x**0.5:
        for j in range(max(p), math.floor(x**0.5) + 1):
            if all([j % k != 0 for k in p]):
                p.append(j)
    i = 0
    while i <= len(p)-1:
        if x%p[i] == 0:
            return False
        if p[i] > x**0.5:
            break;
        i += 1
    return True def isprime(x):
    if x == 2:
        return True
    if x == 3:
        return True
    if max(p) < x**0.5:
        for j in range(max(p), math.floor(x**0.5) + 1):
            if all([j % k != 0 for k in p]):
                p.append(j)
    i = 0
    while i <= len(p)-1:
        if x%p[i] == 0:
            return False
        if p[i] > x**0.5:
            break;
        i += 1
    return True isprime p = [2] [2] p
import math

p = [2]
    
def isprime(x):
    if x == 2:
        return True
    if x == 3:
        return True
    if max(p) < x**0.5:
        for j in range(max(p), math.floor(x**0.5) + 1):
            if all([j % k != 0 for k in p]):
                p.append(j)
    i = 0
    while i <= len(p)-1:
        if x%p[i] == 0:
            return False
        if p[i] > x**0.5:
            break;
        i += 1
    return True


n = int(input())
res = 0
for i in range(n):
    k = int(input())
    if isprime(k):
        res += 1
print(res)