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