def isPrime(n):
    if (n == 1): return False
    if (n == 2): return True
    if (0 == n % 2) : return False
    i = 2
    while(n >= i * i):
        if (0 == n % i): return False
        i += 1
    return True

def main():
    c = 0
    n = input()
    for i in range(n):
        if (isPrime(input())):
            c += 1
    print(c)

main() def isPrime(n):
    if (n == 1): return False
    if (n == 2): return True
    if (0 == n % 2) : return False
    i = 2
    while(n >= i * i):
        if (0 == n % i): return False
        i += 1
    return True isPrime if (n == 1): return False
     n == 1 n 1 if (n == 2): return True
     n == 2 n 2 if (0 == n % 2) : return False
     0 == n % 2 0 n % 2 n 2 i = 2 i 2 while(n >= i * i):
        if (0 == n % i): return False
        i += 1
     n >= i * i n i * i i i if (0 == n % i): return False
         0 == n % i 0 n % i n i i += 1 i 1 return True True n n def main():
    c = 0
    n = input()
    for i in range(n):
        if (isPrime(input())):
            c += 1
    print(c) main c = 0 c 0 n = input() n input() input for i in range(n):
        if (isPrime(input())):
            c += 1
     i range(n) range n if (isPrime(input())):
            c += 1
     isPrime(input()) isPrime input() input c += 1 c 1 print(c) print c main() main def isPrime(n):
    if (n == 1): return False
    if (n == 2): return True
    if (0 == n % 2) : return False
    i = 2
    while(n >= i * i):
        if (0 == n % i): return False
        i += 1
    return True def isPrime(n):
    if (n == 1): return False
    if (n == 2): return True
    if (0 == n % 2) : return False
    i = 2
    while(n >= i * i):
        if (0 == n % i): return False
        i += 1
    return True isPrime def main():
    c = 0
    n = input()
    for i in range(n):
        if (isPrime(input())):
            c += 1
    print(c) def main():
    c = 0
    n = input()
    for i in range(n):
        if (isPrime(input())):
            c += 1
    print(c) main
def isPrime(n):
    if (n == 1): return False
    if (n == 2): return True
    if (0 == n % 2) : return False
    i = 2
    while(n >= i * i):
        if (0 == n % i): return False
        i += 1
    return True

def main():
    c = 0
    n = input()
    for i in range(n):
        if (isPrime(input())):
            c += 1
    print(c)

main()