#!/usr/bin/env python
# -*- coding:utf-8 -*-
#from __future__ import print_function
import time
import sys
import io
import re
import math
start = time.clock()
cnt=0
#sute=0
N=int(raw_input())
for j in range(N):
    x=int(raw_input())
    if x<2: pass
#    elif x==2 or x==3 or x==5 or x==7 or x==11: cnt+=1
    elif x==2: cnt+=1
    elif x%2==1:
        for i in xrange(3, int(x**0.5)+1, 2):
            if x%i==0:
                break
        else:
            cnt+=1
print cnt