import java.util.*;

public class Main{
    public static void main(String[] args){
	int count = 0;
	boolean p = true;
	Scanner a = new Scanner(System.in);
	int n = a.nextInt();
	int m[] = new int[n];
	for(int i = 0; i < n; i++){
	    m[i] = a.nextInt();
	}
	for(int i=0; i<n; i++){
	    p = true;
	    if(m[i]==2){
	        count++;
	    }
	    else if(m[i]>2 && m[i]%2==0){
	        continue;
	    }
	    else{
		for(int j=3; j <= Math.sqrt(m[i]); j+=2){
		    if(m[i]%j == 0){
			p = false;
			break;
		    }
		}
		if(p){
		count++;
		}
	    }
	}
	System.out.println(count);
    }
}
 import java.util.*; util.* java public class Main{
    public static void main(String[] args){
	int count = 0;
	boolean p = true;
	Scanner a = new Scanner(System.in);
	int n = a.nextInt();
	int m[] = new int[n];
	for(int i = 0; i < n; i++){
	    m[i] = a.nextInt();
	}
	for(int i=0; i<n; i++){
	    p = true;
	    if(m[i]==2){
	        count++;
	    }
	    else if(m[i]>2 && m[i]%2==0){
	        continue;
	    }
	    else{
		for(int j=3; j <= Math.sqrt(m[i]); j+=2){
		    if(m[i]%j == 0){
			p = false;
			break;
		    }
		}
		if(p){
		count++;
		}
	    }
	}
	System.out.println(count);
    }
} Main public static void main(String[] args){
	int count = 0;
	boolean p = true;
	Scanner a = new Scanner(System.in);
	int n = a.nextInt();
	int m[] = new int[n];
	for(int i = 0; i < n; i++){
	    m[i] = a.nextInt();
	}
	for(int i=0; i<n; i++){
	    p = true;
	    if(m[i]==2){
	        count++;
	    }
	    else if(m[i]>2 && m[i]%2==0){
	        continue;
	    }
	    else{
		for(int j=3; j <= Math.sqrt(m[i]); j+=2){
		    if(m[i]%j == 0){
			p = false;
			break;
		    }
		}
		if(p){
		count++;
		}
	    }
	}
	System.out.println(count);
    } main {
	int count = 0;
	boolean p = true;
	Scanner a = new Scanner(System.in);
	int n = a.nextInt();
	int m[] = new int[n];
	for(int i = 0; i < n; i++){
	    m[i] = a.nextInt();
	}
	for(int i=0; i<n; i++){
	    p = true;
	    if(m[i]==2){
	        count++;
	    }
	    else if(m[i]>2 && m[i]%2==0){
	        continue;
	    }
	    else{
		for(int j=3; j <= Math.sqrt(m[i]); j+=2){
		    if(m[i]%j == 0){
			p = false;
			break;
		    }
		}
		if(p){
		count++;
		}
	    }
	}
	System.out.println(count);
    } int count = 0; count 0 boolean p = true; p true Scanner a = new Scanner(System.in); a new Scanner(System.in) int n = a.nextInt(); n a.nextInt() a.nextInt a int m[] = new int[n]; m new int[n] n for(int i = 0; i < n; i++){
	    m[i] = a.nextInt();
	} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
	    m[i] = a.nextInt();
	} {
	    m[i] = a.nextInt();
	} m[i] = a.nextInt() m[i] m i a.nextInt() a.nextInt a for(int i=0; i<n; i++){
	    p = true;
	    if(m[i]==2){
	        count++;
	    }
	    else if(m[i]>2 && m[i]%2==0){
	        continue;
	    }
	    else{
		for(int j=3; j <= Math.sqrt(m[i]); j+=2){
		    if(m[i]%j == 0){
			p = false;
			break;
		    }
		}
		if(p){
		count++;
		}
	    }
	} int i=0; int i=0; i 0 i<n i n i++ i++ i {
	    p = true;
	    if(m[i]==2){
	        count++;
	    }
	    else if(m[i]>2 && m[i]%2==0){
	        continue;
	    }
	    else{
		for(int j=3; j <= Math.sqrt(m[i]); j+=2){
		    if(m[i]%j == 0){
			p = false;
			break;
		    }
		}
		if(p){
		count++;
		}
	    }
	} {
	    p = true;
	    if(m[i]==2){
	        count++;
	    }
	    else if(m[i]>2 && m[i]%2==0){
	        continue;
	    }
	    else{
		for(int j=3; j <= Math.sqrt(m[i]); j+=2){
		    if(m[i]%j == 0){
			p = false;
			break;
		    }
		}
		if(p){
		count++;
		}
	    }
	} p = true p true if(m[i]==2){
	        count++;
	    }
	    else if(m[i]>2 && m[i]%2==0){
	        continue;
	    }
	    else{
		for(int j=3; j <= Math.sqrt(m[i]); j+=2){
		    if(m[i]%j == 0){
			p = false;
			break;
		    }
		}
		if(p){
		count++;
		}
	    } m[i]==2 m[i] m i 2 {
	        count++;
	    } count++ count if(m[i]>2 && m[i]%2==0){
	        continue;
	    }
	    else{
		for(int j=3; j <= Math.sqrt(m[i]); j+=2){
		    if(m[i]%j == 0){
			p = false;
			break;
		    }
		}
		if(p){
		count++;
		}
	    } m[i]>2 && m[i]%2==0 m[i]>2 m[i] m i 2 m[i]%2==0 m[i]%2 m[i] m i 2 0 {
	        continue;
	    } continue; {
		for(int j=3; j <= Math.sqrt(m[i]); j+=2){
		    if(m[i]%j == 0){
			p = false;
			break;
		    }
		}
		if(p){
		count++;
		}
	    } for(int j=3; j <= Math.sqrt(m[i]); j+=2){
		    if(m[i]%j == 0){
			p = false;
			break;
		    }
		} int j=3; int j=3; j 3 j <= Math.sqrt(m[i]) j Math.sqrt(m[i]) Math.sqrt Math m[i] m i j+=2 j+=2 j 2 {
		    if(m[i]%j == 0){
			p = false;
			break;
		    }
		} {
		    if(m[i]%j == 0){
			p = false;
			break;
		    }
		} if(m[i]%j == 0){
			p = false;
			break;
		    } m[i]%j == 0 m[i]%j m[i] m i j 0 {
			p = false;
			break;
		    } p = false p false break; if(p){
		count++;
		} p {
		count++;
		} count++ count System.out.println(count) System.out.println System.out System System.out count String[] args args public class Main{
    public static void main(String[] args){
	int count = 0;
	boolean p = true;
	Scanner a = new Scanner(System.in);
	int n = a.nextInt();
	int m[] = new int[n];
	for(int i = 0; i < n; i++){
	    m[i] = a.nextInt();
	}
	for(int i=0; i<n; i++){
	    p = true;
	    if(m[i]==2){
	        count++;
	    }
	    else if(m[i]>2 && m[i]%2==0){
	        continue;
	    }
	    else{
		for(int j=3; j <= Math.sqrt(m[i]); j+=2){
		    if(m[i]%j == 0){
			p = false;
			break;
		    }
		}
		if(p){
		count++;
		}
	    }
	}
	System.out.println(count);
    }
} public class Main{
    public static void main(String[] args){
	int count = 0;
	boolean p = true;
	Scanner a = new Scanner(System.in);
	int n = a.nextInt();
	int m[] = new int[n];
	for(int i = 0; i < n; i++){
	    m[i] = a.nextInt();
	}
	for(int i=0; i<n; i++){
	    p = true;
	    if(m[i]==2){
	        count++;
	    }
	    else if(m[i]>2 && m[i]%2==0){
	        continue;
	    }
	    else{
		for(int j=3; j <= Math.sqrt(m[i]); j+=2){
		    if(m[i]%j == 0){
			p = false;
			break;
		    }
		}
		if(p){
		count++;
		}
	    }
	}
	System.out.println(count);
    }
} Main
import java.util.*;

public class Main{
    public static void main(String[] args){
	int count = 0;
	boolean p = true;
	Scanner a = new Scanner(System.in);
	int n = a.nextInt();
	int m[] = new int[n];
	for(int i = 0; i < n; i++){
	    m[i] = a.nextInt();
	}
	for(int i=0; i<n; i++){
	    p = true;
	    if(m[i]==2){
	        count++;
	    }
	    else if(m[i]>2 && m[i]%2==0){
	        continue;
	    }
	    else{
		for(int j=3; j <= Math.sqrt(m[i]); j+=2){
		    if(m[i]%j == 0){
			p = false;
			break;
		    }
		}
		if(p){
		count++;
		}
	    }
	}
	System.out.println(count);
    }
}

