from math import sqrt, floor, ceil

def main():
    alist = []
    for _ in range(int(input())):
        alist.append(int(input()))

    def is_prime(n):
        if n == 2:
            return True

        if n <= 1 or n % 2 == 0:
            return False

        # n = ceil(sqrt(n))
        for i in range(3, n, 2):
            if n % i*i == 0:
                return False
        return True

    result = sum([is_prime(n) for n in alist])
    print(result)

main()

