def division(x,y):
    if y == 0:
        return x
    division(y, x%y)

def checker(x):
    for i in range(2,x//2+1):
        v = division(x,i)
        if v != 1:
            return True

q = int(input())
cnt = 0
for _ in range(q):
    han = int(input())
    if checker(han):
        cnt += 1

print(cnt)