import java.lang.*;
import java.io.*;
import java.math.*;

public class Main{
    public static void main(String[] args)throws IOException{
	InputStreamReader isr = new InputStreamReader(System.in);
	BufferedReader br=new BufferedReader(isr);
	String nst = br.readLine();
	int n = Integer.parseInt(nst);
	int x,cnt=0;
	for(int i=0;i<n;i++){
	    boolean flag = true;
	    nst = br.readLine();
	    x=Integer.parseInt(nst);
	    for(int j=2;j*j<=x;j++)
		if(x%j==0)
		    flag=false;
	    if(flag)
		cnt++;
	}
	System.out.println(cnt);
    }
} import java.lang.*; lang.* java import java.io.*; io.* java import java.math.*; math.* java public class Main{
    public static void main(String[] args)throws IOException{
	InputStreamReader isr = new InputStreamReader(System.in);
	BufferedReader br=new BufferedReader(isr);
	String nst = br.readLine();
	int n = Integer.parseInt(nst);
	int x,cnt=0;
	for(int i=0;i<n;i++){
	    boolean flag = true;
	    nst = br.readLine();
	    x=Integer.parseInt(nst);
	    for(int j=2;j*j<=x;j++)
		if(x%j==0)
		    flag=false;
	    if(flag)
		cnt++;
	}
	System.out.println(cnt);
    }
} Main public static void main(String[] args)throws IOException{
	InputStreamReader isr = new InputStreamReader(System.in);
	BufferedReader br=new BufferedReader(isr);
	String nst = br.readLine();
	int n = Integer.parseInt(nst);
	int x,cnt=0;
	for(int i=0;i<n;i++){
	    boolean flag = true;
	    nst = br.readLine();
	    x=Integer.parseInt(nst);
	    for(int j=2;j*j<=x;j++)
		if(x%j==0)
		    flag=false;
	    if(flag)
		cnt++;
	}
	System.out.println(cnt);
    } main {
	InputStreamReader isr = new InputStreamReader(System.in);
	BufferedReader br=new BufferedReader(isr);
	String nst = br.readLine();
	int n = Integer.parseInt(nst);
	int x,cnt=0;
	for(int i=0;i<n;i++){
	    boolean flag = true;
	    nst = br.readLine();
	    x=Integer.parseInt(nst);
	    for(int j=2;j*j<=x;j++)
		if(x%j==0)
		    flag=false;
	    if(flag)
		cnt++;
	}
	System.out.println(cnt);
    } InputStreamReader isr = new InputStreamReader(System.in); isr new InputStreamReader(System.in) BufferedReader br=new BufferedReader(isr); br new BufferedReader(isr) String nst = br.readLine(); nst br.readLine() br.readLine br int n = Integer.parseInt(nst); n Integer.parseInt(nst) Integer.parseInt Integer nst int x x cnt=0; cnt 0 for(int i=0;i<n;i++){
	    boolean flag = true;
	    nst = br.readLine();
	    x=Integer.parseInt(nst);
	    for(int j=2;j*j<=x;j++)
		if(x%j==0)
		    flag=false;
	    if(flag)
		cnt++;
	} int i=0; int i=0; i 0 i<n i n i++ i++ i {
	    boolean flag = true;
	    nst = br.readLine();
	    x=Integer.parseInt(nst);
	    for(int j=2;j*j<=x;j++)
		if(x%j==0)
		    flag=false;
	    if(flag)
		cnt++;
	} {
	    boolean flag = true;
	    nst = br.readLine();
	    x=Integer.parseInt(nst);
	    for(int j=2;j*j<=x;j++)
		if(x%j==0)
		    flag=false;
	    if(flag)
		cnt++;
	} boolean flag = true; flag true nst = br.readLine() nst br.readLine() br.readLine br x=Integer.parseInt(nst) x Integer.parseInt(nst) Integer.parseInt Integer nst for(int j=2;j*j<=x;j++)
		if(x%j==0)
		    flag=false; int j=2; int j=2; j 2 j*j<=x j*j j j x j++ j++ j if(x%j==0)
		    flag=false; if(x%j==0)
		    flag=false; x%j==0 x%j x j 0 flag=false flag false if(flag)
		cnt++; flag cnt++ cnt System.out.println(cnt) System.out.println System.out System System.out cnt String[] args args public class Main{
    public static void main(String[] args)throws IOException{
	InputStreamReader isr = new InputStreamReader(System.in);
	BufferedReader br=new BufferedReader(isr);
	String nst = br.readLine();
	int n = Integer.parseInt(nst);
	int x,cnt=0;
	for(int i=0;i<n;i++){
	    boolean flag = true;
	    nst = br.readLine();
	    x=Integer.parseInt(nst);
	    for(int j=2;j*j<=x;j++)
		if(x%j==0)
		    flag=false;
	    if(flag)
		cnt++;
	}
	System.out.println(cnt);
    }
} public class Main{
    public static void main(String[] args)throws IOException{
	InputStreamReader isr = new InputStreamReader(System.in);
	BufferedReader br=new BufferedReader(isr);
	String nst = br.readLine();
	int n = Integer.parseInt(nst);
	int x,cnt=0;
	for(int i=0;i<n;i++){
	    boolean flag = true;
	    nst = br.readLine();
	    x=Integer.parseInt(nst);
	    for(int j=2;j*j<=x;j++)
		if(x%j==0)
		    flag=false;
	    if(flag)
		cnt++;
	}
	System.out.println(cnt);
    }
} Main
import java.lang.*;
import java.io.*;
import java.math.*;

public class Main{
    public static void main(String[] args)throws IOException{
	InputStreamReader isr = new InputStreamReader(System.in);
	BufferedReader br=new BufferedReader(isr);
	String nst = br.readLine();
	int n = Integer.parseInt(nst);
	int x,cnt=0;
	for(int i=0;i<n;i++){
	    boolean flag = true;
	    nst = br.readLine();
	    x=Integer.parseInt(nst);
	    for(int j=2;j*j<=x;j++)
		if(x%j==0)
		    flag=false;
	    if(flag)
		cnt++;
	}
	System.out.println(cnt);
    }
}