n = int(input())
ls = [int(input()) for _ in range(n)]

def judge(n):
    if n == 2 or n == 3:
        return 1
    div = 3
    while div < n:
        if n%2 == 0 or n%div == 0:
            return 0
        else:  
            div += 2
    return 1

print(sum(map(judge, ls)))
