#!/usr/bin/env python
from __future__ import division, print_function
from sys import stdin
cnt = n = int(stdin.readline())
for _ in range(n):
    v = int(stdin.readline())
    if v == 2:
        continue
    elif v % 2 == 0:
        cnt -= 1
    else:
        for i in range(3, v//2, 2):
            if v % i == 0:
                cnt -= 1
                break
print(cnt)