def g(n):
    for _ in range(n):
        t = int(input())

        if t == 2 or t == 3:
            yield 1
        else:
            for i in range(2, t // 2 + 1):
                if t % i == 0:
                    yield 0
                    break
            else:
                yield 1

n = int(input())
print(sum(g(n)))