import java.util.ArrayList;
import java.util.List;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;

class Main {

	static final int MAX = 10000;

	public static void main(String[] args) {

		int primecount = 0;
		Input stdIn = new Input();

		int n = stdIn.getValue();

		List<Integer> values = new ArrayList<>();
		for(int i = 0; i < n; i++) {
			values.add(stdIn.getValue());
		}

//		List<Integer> primeList = createPrimeList(MAX);
//		System.out.println(primeList);
//		System.out.println(primeList.size());

		for(int i = 0; i < n; i++) {
//			System.out.println("values[i] :" + values.get(i));
			if(checkPrime(values.get(i))) {
				primecount++;
			}
		}

		System.out.println(primecount);

		stdIn.close();
	}

	public static boolean checkPrime(int n) {
		boolean b = true;
		if(n == 1) {
			return b;
		} else if(n == 2) {
			return b;
		} else if(n % 2 ==0) {
			return false;
		}

		for(int i = 3; i <= Math.sqrt(n); i += 2) {
			if(n % i == 0) {
				b = false;
			}
		}
		return b;
	}

	public static List<Integer> createPrimeList(int max) {

		List<Integer> primeList = new ArrayList<>();
		primeList.add(2);

		for(int i = 3; i < max; i += 2) {
			boolean b = true;
			for(int j = 3; j <= Math.sqrt(i); j += 2) {
				if(i % j == 0) {
					b = false;
				}
			}
			if(b) {
				primeList.add(i);
			}
		}
		return primeList;
	}
}
class Input{
	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

	public Input() {
	}

	public int getValue() {
		int n = 0;
		try {
			n = Integer.parseInt(br.readLine());
		} catch (IOException e) {
			e.printStackTrace();
		}
		return n;
	}

	public List<Integer> getLine() {
		try {
			String[] s = br.readLine().trim().split(" ");
			List<Integer> ary = new ArrayList<>();
			for (int i = 0; i < s.length; i++) {
				ary.add(Integer.parseInt(s[i]));
			}
			return ary;
		} catch (IOException e) {
			e.printStackTrace();
		}
		return null;
	}

	public void close() {
		try {
			br.close();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
} import java.util.ArrayList; ArrayList java.util import java.util.List; List java.util import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.ArrayList; ArrayList java.util import java.util.List; List java.util class Main {

	static final int MAX = 10000;

	public static void main(String[] args) {

		int primecount = 0;
		Input stdIn = new Input();

		int n = stdIn.getValue();

		List<Integer> values = new ArrayList<>();
		for(int i = 0; i < n; i++) {
			values.add(stdIn.getValue());
		}

//		List<Integer> primeList = createPrimeList(MAX);
//		System.out.println(primeList);
//		System.out.println(primeList.size());

		for(int i = 0; i < n; i++) {
//			System.out.println("values[i] :" + values.get(i));
			if(checkPrime(values.get(i))) {
				primecount++;
			}
		}

		System.out.println(primecount);

		stdIn.close();
	}

	public static boolean checkPrime(int n) {
		boolean b = true;
		if(n == 1) {
			return b;
		} else if(n == 2) {
			return b;
		} else if(n % 2 ==0) {
			return false;
		}

		for(int i = 3; i <= Math.sqrt(n); i += 2) {
			if(n % i == 0) {
				b = false;
			}
		}
		return b;
	}

	public static List<Integer> createPrimeList(int max) {

		List<Integer> primeList = new ArrayList<>();
		primeList.add(2);

		for(int i = 3; i < max; i += 2) {
			boolean b = true;
			for(int j = 3; j <= Math.sqrt(i); j += 2) {
				if(i % j == 0) {
					b = false;
				}
			}
			if(b) {
				primeList.add(i);
			}
		}
		return primeList;
	}
} Main static final int MAX = 10000; MAX 10000 public static void main(String[] args) {

		int primecount = 0;
		Input stdIn = new Input();

		int n = stdIn.getValue();

		List<Integer> values = new ArrayList<>();
		for(int i = 0; i < n; i++) {
			values.add(stdIn.getValue());
		}

//		List<Integer> primeList = createPrimeList(MAX);
//		System.out.println(primeList);
//		System.out.println(primeList.size());

		for(int i = 0; i < n; i++) {
//			System.out.println("values[i] :" + values.get(i));
			if(checkPrime(values.get(i))) {
				primecount++;
			}
		}

		System.out.println(primecount);

		stdIn.close();
	} main {

		int primecount = 0;
		Input stdIn = new Input();

		int n = stdIn.getValue();

		List<Integer> values = new ArrayList<>();
		for(int i = 0; i < n; i++) {
			values.add(stdIn.getValue());
		}

//		List<Integer> primeList = createPrimeList(MAX);
//		System.out.println(primeList);
//		System.out.println(primeList.size());

		for(int i = 0; i < n; i++) {
//			System.out.println("values[i] :" + values.get(i));
			if(checkPrime(values.get(i))) {
				primecount++;
			}
		}

		System.out.println(primecount);

		stdIn.close();
	} int primecount = 0; primecount 0 Input stdIn = new Input(); stdIn new Input() int n = stdIn.getValue(); n stdIn.getValue() stdIn.getValue stdIn List<Integer> values = new ArrayList<>(); values new ArrayList<>() for(int i = 0; i < n; i++) {
			values.add(stdIn.getValue());
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			values.add(stdIn.getValue());
		} {
			values.add(stdIn.getValue());
		} values.add(stdIn.getValue()) values.add values stdIn.getValue() stdIn.getValue stdIn for(int i = 0; i < n; i++) {
//			System.out.println("values[i] :" + values.get(i));
			if(checkPrime(values.get(i))) {
				primecount++;
			}
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
//			System.out.println("values[i] :" + values.get(i));
			if(checkPrime(values.get(i))) {
				primecount++;
			}
		} {
//			System.out.println("values[i] :" + values.get(i));
			if(checkPrime(values.get(i))) {
				primecount++;
			}
		} if(checkPrime(values.get(i))) {
				primecount++;
			} checkPrime(values.get(i)) checkPrime values.get(i) values.get values i {
				primecount++;
			} primecount++ primecount System.out.println(primecount) System.out.println System.out System System.out primecount stdIn.close() stdIn.close stdIn String[] args args public static boolean checkPrime(int n) {
		boolean b = true;
		if(n == 1) {
			return b;
		} else if(n == 2) {
			return b;
		} else if(n % 2 ==0) {
			return false;
		}

		for(int i = 3; i <= Math.sqrt(n); i += 2) {
			if(n % i == 0) {
				b = false;
			}
		}
		return b;
	} checkPrime {
		boolean b = true;
		if(n == 1) {
			return b;
		} else if(n == 2) {
			return b;
		} else if(n % 2 ==0) {
			return false;
		}

		for(int i = 3; i <= Math.sqrt(n); i += 2) {
			if(n % i == 0) {
				b = false;
			}
		}
		return b;
	} boolean b = true; b true if(n == 1) {
			return b;
		} else if(n == 2) {
			return b;
		} else if(n % 2 ==0) {
			return false;
		} n == 1 n 1 {
			return b;
		} return b; b if(n == 2) {
			return b;
		} else if(n % 2 ==0) {
			return false;
		} n == 2 n 2 {
			return b;
		} return b; b if(n % 2 ==0) {
			return false;
		} n % 2 ==0 n % 2 n 2 0 {
			return false;
		} return false; false for(int i = 3; i <= Math.sqrt(n); i += 2) {
			if(n % i == 0) {
				b = false;
			}
		} int i = 3; int i = 3; i 3 i <= Math.sqrt(n) i Math.sqrt(n) Math.sqrt Math n i += 2 i += 2 i 2 {
			if(n % i == 0) {
				b = false;
			}
		} {
			if(n % i == 0) {
				b = false;
			}
		} if(n % i == 0) {
				b = false;
			} n % i == 0 n % i n i 0 {
				b = false;
			} b = false b false return b; b int n n public static List<Integer> createPrimeList(int max) {

		List<Integer> primeList = new ArrayList<>();
		primeList.add(2);

		for(int i = 3; i < max; i += 2) {
			boolean b = true;
			for(int j = 3; j <= Math.sqrt(i); j += 2) {
				if(i % j == 0) {
					b = false;
				}
			}
			if(b) {
				primeList.add(i);
			}
		}
		return primeList;
	} createPrimeList {

		List<Integer> primeList = new ArrayList<>();
		primeList.add(2);

		for(int i = 3; i < max; i += 2) {
			boolean b = true;
			for(int j = 3; j <= Math.sqrt(i); j += 2) {
				if(i % j == 0) {
					b = false;
				}
			}
			if(b) {
				primeList.add(i);
			}
		}
		return primeList;
	} List<Integer> primeList = new ArrayList<>(); primeList new ArrayList<>() primeList.add(2) primeList.add primeList 2 for(int i = 3; i < max; i += 2) {
			boolean b = true;
			for(int j = 3; j <= Math.sqrt(i); j += 2) {
				if(i % j == 0) {
					b = false;
				}
			}
			if(b) {
				primeList.add(i);
			}
		} int i = 3; int i = 3; i 3 i < max i max i += 2 i += 2 i 2 {
			boolean b = true;
			for(int j = 3; j <= Math.sqrt(i); j += 2) {
				if(i % j == 0) {
					b = false;
				}
			}
			if(b) {
				primeList.add(i);
			}
		} {
			boolean b = true;
			for(int j = 3; j <= Math.sqrt(i); j += 2) {
				if(i % j == 0) {
					b = false;
				}
			}
			if(b) {
				primeList.add(i);
			}
		} boolean b = true; b true for(int j = 3; j <= Math.sqrt(i); j += 2) {
				if(i % j == 0) {
					b = false;
				}
			} int j = 3; int j = 3; j 3 j <= Math.sqrt(i) j Math.sqrt(i) Math.sqrt Math i j += 2 j += 2 j 2 {
				if(i % j == 0) {
					b = false;
				}
			} {
				if(i % j == 0) {
					b = false;
				}
			} if(i % j == 0) {
					b = false;
				} i % j == 0 i % j i j 0 {
					b = false;
				} b = false b false if(b) {
				primeList.add(i);
			} b {
				primeList.add(i);
			} primeList.add(i) primeList.add primeList i return primeList; primeList int max max class Input{
	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

	public Input() {
	}

	public int getValue() {
		int n = 0;
		try {
			n = Integer.parseInt(br.readLine());
		} catch (IOException e) {
			e.printStackTrace();
		}
		return n;
	}

	public List<Integer> getLine() {
		try {
			String[] s = br.readLine().trim().split(" ");
			List<Integer> ary = new ArrayList<>();
			for (int i = 0; i < s.length; i++) {
				ary.add(Integer.parseInt(s[i]));
			}
			return ary;
		} catch (IOException e) {
			e.printStackTrace();
		}
		return null;
	}

	public void close() {
		try {
			br.close();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
} Input BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) public Input() {
	} Input {
	} public int getValue() {
		int n = 0;
		try {
			n = Integer.parseInt(br.readLine());
		} catch (IOException e) {
			e.printStackTrace();
		}
		return n;
	} getValue {
		int n = 0;
		try {
			n = Integer.parseInt(br.readLine());
		} catch (IOException e) {
			e.printStackTrace();
		}
		return n;
	} int n = 0; n 0 try {
			n = Integer.parseInt(br.readLine());
		} catch (IOException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		} IOException e {
			e.printStackTrace();
		} e.printStackTrace() e.printStackTrace e {
			n = Integer.parseInt(br.readLine());
		} n = Integer.parseInt(br.readLine()) n Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br return n; n public List<Integer> getLine() {
		try {
			String[] s = br.readLine().trim().split(" ");
			List<Integer> ary = new ArrayList<>();
			for (int i = 0; i < s.length; i++) {
				ary.add(Integer.parseInt(s[i]));
			}
			return ary;
		} catch (IOException e) {
			e.printStackTrace();
		}
		return null;
	} getLine {
		try {
			String[] s = br.readLine().trim().split(" ");
			List<Integer> ary = new ArrayList<>();
			for (int i = 0; i < s.length; i++) {
				ary.add(Integer.parseInt(s[i]));
			}
			return ary;
		} catch (IOException e) {
			e.printStackTrace();
		}
		return null;
	} try {
			String[] s = br.readLine().trim().split(" ");
			List<Integer> ary = new ArrayList<>();
			for (int i = 0; i < s.length; i++) {
				ary.add(Integer.parseInt(s[i]));
			}
			return ary;
		} catch (IOException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		} IOException e {
			e.printStackTrace();
		} e.printStackTrace() e.printStackTrace e {
			String[] s = br.readLine().trim().split(" ");
			List<Integer> ary = new ArrayList<>();
			for (int i = 0; i < s.length; i++) {
				ary.add(Integer.parseInt(s[i]));
			}
			return ary;
		} String[] s = br.readLine().trim().split(" "); s br.readLine().trim().split(" ") br.readLine().trim().split br.readLine().trim() br.readLine().trim br.readLine() br.readLine br " " List<Integer> ary = new ArrayList<>(); ary new ArrayList<>() for (int i = 0; i < s.length; i++) {
				ary.add(Integer.parseInt(s[i]));
			} int i = 0; int i = 0; i 0 i < s.length i s.length s s.length i++ i++ i {
				ary.add(Integer.parseInt(s[i]));
			} {
				ary.add(Integer.parseInt(s[i]));
			} ary.add(Integer.parseInt(s[i])) ary.add ary Integer.parseInt(s[i]) Integer.parseInt Integer s[i] s i return ary; ary return null; null public void close() {
		try {
			br.close();
		} catch (IOException e) {
			e.printStackTrace();
		}
	} close {
		try {
			br.close();
		} catch (IOException e) {
			e.printStackTrace();
		}
	} try {
			br.close();
		} catch (IOException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		} IOException e {
			e.printStackTrace();
		} e.printStackTrace() e.printStackTrace e {
			br.close();
		} br.close() br.close br
import java.util.ArrayList;
import java.util.List;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;

class Main {

	static final int MAX = 10000;

	public static void main(String[] args) {

		int primecount = 0;
		Input stdIn = new Input();

		int n = stdIn.getValue();

		List<Integer> values = new ArrayList<>();
		for(int i = 0; i < n; i++) {
			values.add(stdIn.getValue());
		}

//		List<Integer> primeList = createPrimeList(MAX);
//		System.out.println(primeList);
//		System.out.println(primeList.size());

		for(int i = 0; i < n; i++) {
//			System.out.println("values[i] :" + values.get(i));
			if(checkPrime(values.get(i))) {
				primecount++;
			}
		}

		System.out.println(primecount);

		stdIn.close();
	}

	public static boolean checkPrime(int n) {
		boolean b = true;
		if(n == 1) {
			return b;
		} else if(n == 2) {
			return b;
		} else if(n % 2 ==0) {
			return false;
		}

		for(int i = 3; i <= Math.sqrt(n); i += 2) {
			if(n % i == 0) {
				b = false;
			}
		}
		return b;
	}

	public static List<Integer> createPrimeList(int max) {

		List<Integer> primeList = new ArrayList<>();
		primeList.add(2);

		for(int i = 3; i < max; i += 2) {
			boolean b = true;
			for(int j = 3; j <= Math.sqrt(i); j += 2) {
				if(i % j == 0) {
					b = false;
				}
			}
			if(b) {
				primeList.add(i);
			}
		}
		return primeList;
	}
}
class Input{
	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

	public Input() {
	}

	public int getValue() {
		int n = 0;
		try {
			n = Integer.parseInt(br.readLine());
		} catch (IOException e) {
			e.printStackTrace();
		}
		return n;
	}

	public List<Integer> getLine() {
		try {
			String[] s = br.readLine().trim().split(" ");
			List<Integer> ary = new ArrayList<>();
			for (int i = 0; i < s.length; i++) {
				ary.add(Integer.parseInt(s[i]));
			}
			return ary;
		} catch (IOException e) {
			e.printStackTrace();
		}
		return null;
	}

	public void close() {
		try {
			br.close();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}