n = int(input())
for i in range(n):
    p = int(input())
    if p in (2,3,5,7):
        continue
    elif not p%2:
        n -= 1
        continue
    for j in range(3,int(p**0.5),2):
        if not p%j:
            n -= 1
            continue
print(n)