def isprime(n):
    check = 1
    if n == 2:
        pass
    elif n == 1 or n % 2 == 0:
        check = 0
    else:
        i = 3
        while i * i <= n:
            if n % i == 0:
                check = 0
                break
            else:
                i += 2
    return check
        

n = int(input())
ans = 0
for k in range(n):
    a = int(input())
    ans += isprime(a)
    
print(ans) def isprime(n):
    check = 1
    if n == 2:
        pass
    elif n == 1 or n % 2 == 0:
        check = 0
    else:
        i = 3
        while i * i <= n:
            if n % i == 0:
                check = 0
                break
            else:
                i += 2
    return check
         isprime check = 1 check 1 if n == 2:
        pass
    elif n == 1 or n % 2 == 0:
        check = 0
    else:
        i = 3
        while i * i <= n:
            if n % i == 0:
                check = 0
                break
            else:
                i += 2
     n == 2 n 2 elif n == 1 or n % 2 == 0:
        check = 0
     n == 1 or n % 2 == 0 n == 1 n 1 n % 2 == 0 n % 2 n 2 0 check = 0 check 0 i = 3 i 3 while i * i <= n:
            if n % i == 0:
                check = 0
                break
            else:
                i += 2
     i * i <= n i * i i i n if n % i == 0:
                check = 0
                break
            else:
                i += 2
     n % i == 0 n % i n i 0 check = 0 check 0 break i += 2 i 2 return check check n n n = int(input()) n int(input()) int input() input ans = 0 ans 0 for k in range(n):
    a = int(input())
    ans += isprime(a)
     k range(n) range n a = int(input()) a int(input()) int input() input ans += isprime(a) ans isprime(a) isprime a print(ans) print ans ans = 0 0 ans a = int(input()) int(input()) a ans += isprime(a) isprime(a) ans def isprime(n):
    check = 1
    if n == 2:
        pass
    elif n == 1 or n % 2 == 0:
        check = 0
    else:
        i = 3
        while i * i <= n:
            if n % i == 0:
                check = 0
                break
            else:
                i += 2
    return check
         def isprime(n):
    check = 1
    if n == 2:
        pass
    elif n == 1 or n % 2 == 0:
        check = 0
    else:
        i = 3
        while i * i <= n:
            if n % i == 0:
                check = 0
                break
            else:
                i += 2
    return check
         isprime n = int(input()) int(input()) n
def isprime(n):
    check = 1
    if n == 2:
        pass
    elif n == 1 or n % 2 == 0:
        check = 0
    else:
        i = 3
        while i * i <= n:
            if n % i == 0:
                check = 0
                break
            else:
                i += 2
    return check
        

n = int(input())
ans = 0
for k in range(n):
    a = int(input())
    ans += isprime(a)
    
print(ans)
