


def divisor(num):
    for i in range(2, num):
        if num % i == 0:
            return True

    return False



N = input()
cnt = 0
for itr in N:
    num = int(input())
    if divisor(num):
        cnt = cnt+1

print(cnt, end="")
