import java.util.*;
public class Main{
    public static void main(String[] args){
	new Main().run();
    }
    Scanner sc = new Scanner(System.in);

    int n, count;
    boolean[] p;

    void run(){
	count = 0;
	p = new boolean[100000000];
	setP();
	while(sc.hasNext()){
	    n = sc.nextInt();
	    if(p[n]) {
		count++;
	     	p[n] = false;
	    }
	}
	System.out.println(count);
    }  

    void setP(){
	Arrays.fill(p, true);
	p[0] = p[1] = false;
	for(int i=2; i<p.length; i++)
	    if(p[i])
		for(int j=i*2; j<p.length; j+=i)
		    p[j] = false;
    }
}
/tmp/hf-datasets-cache/medium/datasets/42704881117311-config-parquet-and-info-qiankunmu-Project_CodeNet-896c9d36/hub/datasets--qiankunmu--Project_CodeNet_Python800_and_Java250/snapshots/c899fde44a77ba1cc14973ed3de064e4ff3aadc7/Project_CodeNet_Java250.tar.gz