import math

def is_prime(n):
    if n == 1:
        return False
    if n % 2 == 0:
        return False
    for i in range(2, math.ceil(n**0.5)):
        if n % i == 0:
            return False
    return True

def run():
    n = int(input())
    n_prime = 0
    for i in range(n):
        if is_prime(int(input())):
            n_prime += 1
    print(n_prime)

if __name__ == '__main__':
    run()
