import java.util.*;
import java.io.*;
public class Main
{
public static void main(String args[]) throws IOException{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int N = Integer.parseInt(br.readLine());
StringTokenizer st = new StringTokenizer(br.readLine());
boolean[] c = calc();
int result = 0;
for(int i = 0; i < N; i++){
if(!c[Integer.parseInt(st.nextToken())])
result++;
}
System.out.println(result);
}
public static boolean[] calc(){
boolean[] check = new boolean[1001];
check[1] = true;
for(int i = 2; i < 1001; i++){
if(check[i])
continue;
for(int j = i*2; j < 1001; j+=i)
check[j] = true;
}
return check;
}
}