import sys

def solve():
    n = int(sys.stdin.readline())

    ans = sum(is_prime(int(sys.stdin.readline())) for i in range(n))

    print(ans)

def is_prime(n):
    if n < 2 or (n > 2 and not(n & 1)):
        return False

    for p in range(3, n, 2):
        if p*p > n:
            break
        if not(n % p):
            return False

    return True

if __name__ == '__main__':
    solve() import sys sys def solve():
    n = int(sys.stdin.readline())

    ans = sum(is_prime(int(sys.stdin.readline())) for i in range(n))

    print(ans) solve n = int(sys.stdin.readline()) n int(sys.stdin.readline()) int sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline ans = sum(is_prime(int(sys.stdin.readline())) for i in range(n)) ans sum(is_prime(int(sys.stdin.readline())) for i in range(n)) sum is_prime(int(sys.stdin.readline())) is_prime int(sys.stdin.readline()) int sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline print(ans) print ans def is_prime(n):
    if n < 2 or (n > 2 and not(n & 1)):
        return False

    for p in range(3, n, 2):
        if p*p > n:
            break
        if not(n % p):
            return False

    return True is_prime if n < 2 or (n > 2 and not(n & 1)):
        return False

     n < 2 or (n > 2 and not(n & 1)) n < 2 n 2 n > 2 and not(n & 1) n > 2 n 2 not(n & 1) n & 1 n 1 return False False for p in range(3, n, 2):
        if p*p > n:
            break
        if not(n % p):
            return False

     p range(3, n, 2) range 3 n 2 if p*p > n:
            break
         p*p > n p*p p p n break if not(n % p):
            return False

     not(n % p) n % p n p return False False return True True n n if __name__ == '__main__':
    solve() __name__ == '__main__' __name__ '__main__' solve() solve def is_prime(n):
    if n < 2 or (n > 2 and not(n & 1)):
        return False

    for p in range(3, n, 2):
        if p*p > n:
            break
        if not(n % p):
            return False

    return True def is_prime(n):
    if n < 2 or (n > 2 and not(n & 1)):
        return False

    for p in range(3, n, 2):
        if p*p > n:
            break
        if not(n % p):
            return False

    return True is_prime def solve():
    n = int(sys.stdin.readline())

    ans = sum(is_prime(int(sys.stdin.readline())) for i in range(n))

    print(ans) def solve():
    n = int(sys.stdin.readline())

    ans = sum(is_prime(int(sys.stdin.readline())) for i in range(n))

    print(ans) solve
import sys

def solve():
    n = int(sys.stdin.readline())

    ans = sum(is_prime(int(sys.stdin.readline())) for i in range(n))

    print(ans)

def is_prime(n):
    if n < 2 or (n > 2 and not(n & 1)):
        return False

    for p in range(3, n, 2):
        if p*p > n:
            break
        if not(n % p):
            return False

    return True

if __name__ == '__main__':
    solve()