import math


def is_prime(num):
    for i in range(2, max(num, math.floor(math.sqrt(num)))):
        if num % i == 0:
            return False
    return True


N = int(input())
nums = [int(input()) for _ in range(N)]
ans = len([num for num in nums if is_prime(num)])
print(ans)