def is_prime(x):

    if x == 2 : return True

    for i in range(2, x):
        if x % i == 0:
            return True

    return False


n = 5
res = 0

for _ in range(n+1):
    x = int(input())
    if is_prime(x): res += 1

print(res)