import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

import javax.lang.model.util.ElementScanner6;

class Main {
    public static boolean isPrime(int a) {
        for (int i = 2; i <= Math.sqrt(a); i++) {
            if (a % i == 0)
                return false;
        }
        return true;
    }

    public static void main(String[] args) {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        try {
            int n = Integer.parseInt(br.readLine());
            int[] nums = new int[n];
            int count = 0;

            for (int i = 0; i < n; i++)
                nums[i] = Integer.parseInt(br.readLine());
            for (int i = 0; i < n; i++) {
                if (isPrime(nums[i]))
                    count++;
            }
            System.out.println(count);
        } catch (IOException e) {
            e.printStackTrace();
        }

    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import javax.lang.model.util.ElementScanner6; ElementScanner6 javax.lang.model.util class Main {
    public static boolean isPrime(int a) {
        for (int i = 2; i <= Math.sqrt(a); i++) {
            if (a % i == 0)
                return false;
        }
        return true;
    }

    public static void main(String[] args) {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        try {
            int n = Integer.parseInt(br.readLine());
            int[] nums = new int[n];
            int count = 0;

            for (int i = 0; i < n; i++)
                nums[i] = Integer.parseInt(br.readLine());
            for (int i = 0; i < n; i++) {
                if (isPrime(nums[i]))
                    count++;
            }
            System.out.println(count);
        } catch (IOException e) {
            e.printStackTrace();
        }

    }
} Main public static boolean isPrime(int a) {
        for (int i = 2; i <= Math.sqrt(a); i++) {
            if (a % i == 0)
                return false;
        }
        return true;
    } isPrime {
        for (int i = 2; i <= Math.sqrt(a); i++) {
            if (a % i == 0)
                return false;
        }
        return true;
    } for (int i = 2; i <= Math.sqrt(a); i++) {
            if (a % i == 0)
                return false;
        } int i = 2; int i = 2; i 2 i <= Math.sqrt(a) i Math.sqrt(a) Math.sqrt Math a i++ i++ i {
            if (a % i == 0)
                return false;
        } {
            if (a % i == 0)
                return false;
        } if (a % i == 0)
                return false; a % i == 0 a % i a i 0 return false; false return true; true int a a public static void main(String[] args) {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        try {
            int n = Integer.parseInt(br.readLine());
            int[] nums = new int[n];
            int count = 0;

            for (int i = 0; i < n; i++)
                nums[i] = Integer.parseInt(br.readLine());
            for (int i = 0; i < n; i++) {
                if (isPrime(nums[i]))
                    count++;
            }
            System.out.println(count);
        } catch (IOException e) {
            e.printStackTrace();
        }

    } main {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        try {
            int n = Integer.parseInt(br.readLine());
            int[] nums = new int[n];
            int count = 0;

            for (int i = 0; i < n; i++)
                nums[i] = Integer.parseInt(br.readLine());
            for (int i = 0; i < n; i++) {
                if (isPrime(nums[i]))
                    count++;
            }
            System.out.println(count);
        } catch (IOException e) {
            e.printStackTrace();
        }

    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) try {
            int n = Integer.parseInt(br.readLine());
            int[] nums = new int[n];
            int count = 0;

            for (int i = 0; i < n; i++)
                nums[i] = Integer.parseInt(br.readLine());
            for (int i = 0; i < n; i++) {
                if (isPrime(nums[i]))
                    count++;
            }
            System.out.println(count);
        } catch (IOException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        } IOException e {
            e.printStackTrace();
        } e.printStackTrace() e.printStackTrace e {
            int n = Integer.parseInt(br.readLine());
            int[] nums = new int[n];
            int count = 0;

            for (int i = 0; i < n; i++)
                nums[i] = Integer.parseInt(br.readLine());
            for (int i = 0; i < n; i++) {
                if (isPrime(nums[i]))
                    count++;
            }
            System.out.println(count);
        } int n = Integer.parseInt(br.readLine()); n Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br int[] nums = new int[n]; nums new int[n] n int count = 0; count 0 for (int i = 0; i < n; i++)
                nums[i] = Integer.parseInt(br.readLine()); int i = 0; int i = 0; i 0 i < n i n i++ i++ i nums[i] = Integer.parseInt(br.readLine()); nums[i] = Integer.parseInt(br.readLine()) nums[i] nums i Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br for (int i = 0; i < n; i++) {
                if (isPrime(nums[i]))
                    count++;
            } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
                if (isPrime(nums[i]))
                    count++;
            } {
                if (isPrime(nums[i]))
                    count++;
            } if (isPrime(nums[i]))
                    count++; isPrime(nums[i]) isPrime nums[i] nums i count++ count System.out.println(count) System.out.println System.out System System.out count String[] args args
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

import javax.lang.model.util.ElementScanner6;

class Main {
    public static boolean isPrime(int a) {
        for (int i = 2; i <= Math.sqrt(a); i++) {
            if (a % i == 0)
                return false;
        }
        return true;
    }

    public static void main(String[] args) {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        try {
            int n = Integer.parseInt(br.readLine());
            int[] nums = new int[n];
            int count = 0;

            for (int i = 0; i < n; i++)
                nums[i] = Integer.parseInt(br.readLine());
            for (int i = 0; i < n; i++) {
                if (isPrime(nums[i]))
                    count++;
            }
            System.out.println(count);
        } catch (IOException e) {
            e.printStackTrace();
        }

    }
}
