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

public class Main {
    private static final int SIZE = 10000000;

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        int count = 0;
        for (int i = 0; i < n; i++) {
            long p = Long.parseLong(br.readLine());
            if (prime(p)) {
                count++;
            }
        }
        System.out.println(count);
    }

    static boolean prime(long n) {
        if (n == 2) {
            return true;
        } else if (n % 2 == 0) {
            return false;
        }
        for (int i = 3; i * i <= n; i += 2) {
            if (n % i == 0) {
                return false;
            }
        }
        return true;
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {
    private static final int SIZE = 10000000;

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        int count = 0;
        for (int i = 0; i < n; i++) {
            long p = Long.parseLong(br.readLine());
            if (prime(p)) {
                count++;
            }
        }
        System.out.println(count);
    }

    static boolean prime(long n) {
        if (n == 2) {
            return true;
        } else if (n % 2 == 0) {
            return false;
        }
        for (int i = 3; i * i <= n; i += 2) {
            if (n % i == 0) {
                return false;
            }
        }
        return true;
    }
} Main private static final int SIZE = 10000000; SIZE 10000000 public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        int count = 0;
        for (int i = 0; i < n; i++) {
            long p = Long.parseLong(br.readLine());
            if (prime(p)) {
                count++;
            }
        }
        System.out.println(count);
    } main {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        int count = 0;
        for (int i = 0; i < n; i++) {
            long p = Long.parseLong(br.readLine());
            if (prime(p)) {
                count++;
            }
        }
        System.out.println(count);
    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int n = Integer.parseInt(br.readLine()); n Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br int count = 0; count 0 for (int i = 0; i < n; i++) {
            long p = Long.parseLong(br.readLine());
            if (prime(p)) {
                count++;
            }
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            long p = Long.parseLong(br.readLine());
            if (prime(p)) {
                count++;
            }
        } {
            long p = Long.parseLong(br.readLine());
            if (prime(p)) {
                count++;
            }
        } long p = Long.parseLong(br.readLine()); p Long.parseLong(br.readLine()) Long.parseLong Long br.readLine() br.readLine br if (prime(p)) {
                count++;
            } prime(p) prime p {
                count++;
            } count++ count System.out.println(count) System.out.println System.out System System.out count String[] args args static boolean prime(long n) {
        if (n == 2) {
            return true;
        } else if (n % 2 == 0) {
            return false;
        }
        for (int i = 3; i * i <= n; i += 2) {
            if (n % i == 0) {
                return false;
            }
        }
        return true;
    } prime {
        if (n == 2) {
            return true;
        } else if (n % 2 == 0) {
            return false;
        }
        for (int i = 3; i * i <= n; i += 2) {
            if (n % i == 0) {
                return false;
            }
        }
        return true;
    } if (n == 2) {
            return true;
        } else if (n % 2 == 0) {
            return false;
        } n == 2 n 2 {
            return true;
        } return true; true if (n % 2 == 0) {
            return false;
        } n % 2 == 0 n % 2 n 2 0 {
            return false;
        } return false; false for (int i = 3; i * i <= n; i += 2) {
            if (n % i == 0) {
                return false;
            }
        } int i = 3; int i = 3; i 3 i * i <= n i * i i i n i += 2 i += 2 i 2 {
            if (n % i == 0) {
                return false;
            }
        } {
            if (n % i == 0) {
                return false;
            }
        } if (n % i == 0) {
                return false;
            } n % i == 0 n % i n i 0 {
                return false;
            } return false; false return true; true long n n public class Main {
    private static final int SIZE = 10000000;

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        int count = 0;
        for (int i = 0; i < n; i++) {
            long p = Long.parseLong(br.readLine());
            if (prime(p)) {
                count++;
            }
        }
        System.out.println(count);
    }

    static boolean prime(long n) {
        if (n == 2) {
            return true;
        } else if (n % 2 == 0) {
            return false;
        }
        for (int i = 3; i * i <= n; i += 2) {
            if (n % i == 0) {
                return false;
            }
        }
        return true;
    }
} public class Main {
    private static final int SIZE = 10000000;

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        int count = 0;
        for (int i = 0; i < n; i++) {
            long p = Long.parseLong(br.readLine());
            if (prime(p)) {
                count++;
            }
        }
        System.out.println(count);
    }

    static boolean prime(long n) {
        if (n == 2) {
            return true;
        } else if (n % 2 == 0) {
            return false;
        }
        for (int i = 3; i * i <= n; i += 2) {
            if (n % i == 0) {
                return false;
            }
        }
        return true;
    }
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
    private static final int SIZE = 10000000;

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        int count = 0;
        for (int i = 0; i < n; i++) {
            long p = Long.parseLong(br.readLine());
            if (prime(p)) {
                count++;
            }
        }
        System.out.println(count);
    }

    static boolean prime(long n) {
        if (n == 2) {
            return true;
        } else if (n % 2 == 0) {
            return false;
        }
        for (int i = 3; i * i <= n; i += 2) {
            if (n % i == 0) {
                return false;
            }
        }
        return true;
    }
}