from math import gcd

magic = [2, 7, 61]

def mul(a, b, n):
    # calculate (a * b) % n
    r, a, b = 0, a % n, b % n
    while b:
        if b & 1:
            r = (a + r) % n
        a = (a + a) % n
        b >>= 1
    return r

def bigmod(a, p, n):
    # calculate (a ** p) % n
    if p == 0:
        return 1
    if p == 1:
        return a % n
    return mul(bigmod(mul(a, a, n), p // 2, n), a if p % 2 else 1, n)

def miller_rabin(n, a):
    if gcd(a, n) == n:
        return True
    if gcd(a, n) != 1:
        return False
    d, r = n-1, 0
    while d % 2 == 0:
        d /= 2
        r += 1
    res = bigmod(a, d, n)
    if res == 1 or res == n-1:
        return True
    while r:
        r -= 1
        res = mul(res, res, n)
        if res == n-1:
            return True
    return False

def isPrime(n):
    for a in magic:
        if not miller_rabin(n, a):
            return False
    return True


num = int(input())
ans = sum(map(int, [isPrime(int(input())) for _ in range(num)]))
print(ans)
 from math import gcd magic = [2, 7, 61] magic [2, 7, 61] 2 7 61 def mul(a, b, n):
    # calculate (a * b) % n
    r, a, b = 0, a % n, b % n
    while b:
        if b & 1:
            r = (a + r) % n
        a = (a + a) % n
        b >>= 1
    return r mul r, a, b = 0, a % n, b % n r 0 a a % n a n b b % n b n while b:
        if b & 1:
            r = (a + r) % n
        a = (a + a) % n
        b >>= 1
     b if b & 1:
            r = (a + r) % n
         b & 1 b 1 r = (a + r) % n r (a + r) % n a + r a r n a = (a + a) % n a (a + a) % n a + a a a n b >>= 1 b 1 return r r a a b b n n def bigmod(a, p, n):
    # calculate (a ** p) % n
    if p == 0:
        return 1
    if p == 1:
        return a % n
    return mul(bigmod(mul(a, a, n), p // 2, n), a if p % 2 else 1, n) bigmod if p == 0:
        return 1
     p == 0 p 0 return 1 1 if p == 1:
        return a % n
     p == 1 p 1 return a % n a % n a n return mul(bigmod(mul(a, a, n), p // 2, n), a if p % 2 else 1, n) mul(bigmod(mul(a, a, n), p // 2, n), a if p % 2 else 1, n) mul bigmod(mul(a, a, n), p // 2, n) bigmod mul(a, a, n) mul a a n p // 2 p 2 n a if p % 2 else 1 p % 2 p 2 a 1 n a a p p n n def miller_rabin(n, a):
    if gcd(a, n) == n:
        return True
    if gcd(a, n) != 1:
        return False
    d, r = n-1, 0
    while d % 2 == 0:
        d /= 2
        r += 1
    res = bigmod(a, d, n)
    if res == 1 or res == n-1:
        return True
    while r:
        r -= 1
        res = mul(res, res, n)
        if res == n-1:
            return True
    return False miller_rabin if gcd(a, n) == n:
        return True
     gcd(a, n) == n gcd(a, n) gcd a n n return True True if gcd(a, n) != 1:
        return False
     gcd(a, n) != 1 gcd(a, n) gcd a n 1 return False False d, r = n-1, 0 d n-1 n 1 r 0 while d % 2 == 0:
        d /= 2
        r += 1
     d % 2 == 0 d % 2 d 2 0 d /= 2 d 2 r += 1 r 1 res = bigmod(a, d, n) res bigmod(a, d, n) bigmod a d n if res == 1 or res == n-1:
        return True
     res == 1 or res == n-1 res == 1 res 1 res == n-1 res n-1 n 1 return True True while r:
        r -= 1
        res = mul(res, res, n)
        if res == n-1:
            return True
     r r -= 1 r 1 res = mul(res, res, n) res mul(res, res, n) mul res res n if res == n-1:
            return True
     res == n-1 res n-1 n 1 return True True return False False n n a a def isPrime(n):
    for a in magic:
        if not miller_rabin(n, a):
            return False
    return True isPrime for a in magic:
        if not miller_rabin(n, a):
            return False
     a magic if not miller_rabin(n, a):
            return False
     not miller_rabin(n, a) miller_rabin(n, a) miller_rabin n a return False False return True True n n num = int(input()) num int(input()) int input() input isPrime(int(input())) for _ in range(num) for _ in range(num) _ range(num) range num for _ in range(num) isPrime(int(input())) isPrime int(input()) int input() input ans = sum(map(int, [isPrime(int(input())) for _ in range(num)])) ans sum(map(int, [isPrime(int(input())) for _ in range(num)])) sum map(int, [isPrime(int(input())) for _ in range(num)]) map int [isPrime(int(input())) for _ in range(num)] print(ans) print ans def miller_rabin(n, a):
    if gcd(a, n) == n:
        return True
    if gcd(a, n) != 1:
        return False
    d, r = n-1, 0
    while d % 2 == 0:
        d /= 2
        r += 1
    res = bigmod(a, d, n)
    if res == 1 or res == n-1:
        return True
    while r:
        r -= 1
        res = mul(res, res, n)
        if res == n-1:
            return True
    return False def miller_rabin(n, a):
    if gcd(a, n) == n:
        return True
    if gcd(a, n) != 1:
        return False
    d, r = n-1, 0
    while d % 2 == 0:
        d /= 2
        r += 1
    res = bigmod(a, d, n)
    if res == 1 or res == n-1:
        return True
    while r:
        r -= 1
        res = mul(res, res, n)
        if res == n-1:
            return True
    return False miller_rabin ans = sum(map(int, [isPrime(int(input())) for _ in range(num)])) sum(map(int, [isPrime(int(input())) for _ in range(num)])) ans def mul(a, b, n):
    # calculate (a * b) % n
    r, a, b = 0, a % n, b % n
    while b:
        if b & 1:
            r = (a + r) % n
        a = (a + a) % n
        b >>= 1
    return r def mul(a, b, n):
    # calculate (a * b) % n
    r, a, b = 0, a % n, b % n
    while b:
        if b & 1:
            r = (a + r) % n
        a = (a + a) % n
        b >>= 1
    return r mul def isPrime(n):
    for a in magic:
        if not miller_rabin(n, a):
            return False
    return True def isPrime(n):
    for a in magic:
        if not miller_rabin(n, a):
            return False
    return True isPrime num = int(input()) int(input()) num def bigmod(a, p, n):
    # calculate (a ** p) % n
    if p == 0:
        return 1
    if p == 1:
        return a % n
    return mul(bigmod(mul(a, a, n), p // 2, n), a if p % 2 else 1, n) def bigmod(a, p, n):
    # calculate (a ** p) % n
    if p == 0:
        return 1
    if p == 1:
        return a % n
    return mul(bigmod(mul(a, a, n), p // 2, n), a if p % 2 else 1, n) bigmod magic = [2, 7, 61] [2, 7, 61] magic
from math import gcd

magic = [2, 7, 61]

def mul(a, b, n):
    # calculate (a * b) % n
    r, a, b = 0, a % n, b % n
    while b:
        if b & 1:
            r = (a + r) % n
        a = (a + a) % n
        b >>= 1
    return r

def bigmod(a, p, n):
    # calculate (a ** p) % n
    if p == 0:
        return 1
    if p == 1:
        return a % n
    return mul(bigmod(mul(a, a, n), p // 2, n), a if p % 2 else 1, n)

def miller_rabin(n, a):
    if gcd(a, n) == n:
        return True
    if gcd(a, n) != 1:
        return False
    d, r = n-1, 0
    while d % 2 == 0:
        d /= 2
        r += 1
    res = bigmod(a, d, n)
    if res == 1 or res == n-1:
        return True
    while r:
        r -= 1
        res = mul(res, res, n)
        if res == n-1:
            return True
    return False

def isPrime(n):
    for a in magic:
        if not miller_rabin(n, a):
            return False
    return True


num = int(input())
ans = sum(map(int, [isPrime(int(input())) for _ in range(num)]))
print(ans)

