import java.util.*;

public class Main {
    private static final Scanner scn = new Scanner(System.in);
    
    public static void main(String[] args) {
        int c = 0, n = scn.nextInt();
        for(int i = 0; i < n; i++) {
            c += primeCheck(scn.nextInt());
        }
        System.out.println(c);
    }
    
    private static int primeCheck(int x) {
        int rslt = 1;
        if(x < 2 || x > 3 && x % 2 == 0) {
            rslt = 0;
        }
        for(int i = 3; i <= x / i; i += 2) {
            if(x % i == 0) {
                rslt = 0;
                break;
            }
        }
        return rslt;
    }
} import java.util.*; util.* java public class Main {
    private static final Scanner scn = new Scanner(System.in);
    
    public static void main(String[] args) {
        int c = 0, n = scn.nextInt();
        for(int i = 0; i < n; i++) {
            c += primeCheck(scn.nextInt());
        }
        System.out.println(c);
    }
    
    private static int primeCheck(int x) {
        int rslt = 1;
        if(x < 2 || x > 3 && x % 2 == 0) {
            rslt = 0;
        }
        for(int i = 3; i <= x / i; i += 2) {
            if(x % i == 0) {
                rslt = 0;
                break;
            }
        }
        return rslt;
    }
} Main private static final Scanner scn = new Scanner(System.in); scn new Scanner(System.in) public static void main(String[] args) {
        int c = 0, n = scn.nextInt();
        for(int i = 0; i < n; i++) {
            c += primeCheck(scn.nextInt());
        }
        System.out.println(c);
    } main {
        int c = 0, n = scn.nextInt();
        for(int i = 0; i < n; i++) {
            c += primeCheck(scn.nextInt());
        }
        System.out.println(c);
    } int c = 0 c 0 n = scn.nextInt(); n scn.nextInt() scn.nextInt scn for(int i = 0; i < n; i++) {
            c += primeCheck(scn.nextInt());
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            c += primeCheck(scn.nextInt());
        } {
            c += primeCheck(scn.nextInt());
        } c += primeCheck(scn.nextInt()) c primeCheck(scn.nextInt()) primeCheck scn.nextInt() scn.nextInt scn System.out.println(c) System.out.println System.out System System.out c String[] args args private static int primeCheck(int x) {
        int rslt = 1;
        if(x < 2 || x > 3 && x % 2 == 0) {
            rslt = 0;
        }
        for(int i = 3; i <= x / i; i += 2) {
            if(x % i == 0) {
                rslt = 0;
                break;
            }
        }
        return rslt;
    } primeCheck {
        int rslt = 1;
        if(x < 2 || x > 3 && x % 2 == 0) {
            rslt = 0;
        }
        for(int i = 3; i <= x / i; i += 2) {
            if(x % i == 0) {
                rslt = 0;
                break;
            }
        }
        return rslt;
    } int rslt = 1; rslt 1 if(x < 2 || x > 3 && x % 2 == 0) {
            rslt = 0;
        } x < 2 || x > 3 && x % 2 == 0 x < 2 x 2 x > 3 && x % 2 == 0 x > 3 x 3 x % 2 == 0 x % 2 x 2 0 {
            rslt = 0;
        } rslt = 0 rslt 0 for(int i = 3; i <= x / i; i += 2) {
            if(x % i == 0) {
                rslt = 0;
                break;
            }
        } int i = 3; int i = 3; i 3 i <= x / i i x / i x i i += 2 i += 2 i 2 {
            if(x % i == 0) {
                rslt = 0;
                break;
            }
        } {
            if(x % i == 0) {
                rslt = 0;
                break;
            }
        } if(x % i == 0) {
                rslt = 0;
                break;
            } x % i == 0 x % i x i 0 {
                rslt = 0;
                break;
            } rslt = 0 rslt 0 break; return rslt; rslt int x x public class Main {
    private static final Scanner scn = new Scanner(System.in);
    
    public static void main(String[] args) {
        int c = 0, n = scn.nextInt();
        for(int i = 0; i < n; i++) {
            c += primeCheck(scn.nextInt());
        }
        System.out.println(c);
    }
    
    private static int primeCheck(int x) {
        int rslt = 1;
        if(x < 2 || x > 3 && x % 2 == 0) {
            rslt = 0;
        }
        for(int i = 3; i <= x / i; i += 2) {
            if(x % i == 0) {
                rslt = 0;
                break;
            }
        }
        return rslt;
    }
} public class Main {
    private static final Scanner scn = new Scanner(System.in);
    
    public static void main(String[] args) {
        int c = 0, n = scn.nextInt();
        for(int i = 0; i < n; i++) {
            c += primeCheck(scn.nextInt());
        }
        System.out.println(c);
    }
    
    private static int primeCheck(int x) {
        int rslt = 1;
        if(x < 2 || x > 3 && x % 2 == 0) {
            rslt = 0;
        }
        for(int i = 3; i <= x / i; i += 2) {
            if(x % i == 0) {
                rslt = 0;
                break;
            }
        }
        return rslt;
    }
} Main
import java.util.*;

public class Main {
    private static final Scanner scn = new Scanner(System.in);
    
    public static void main(String[] args) {
        int c = 0, n = scn.nextInt();
        for(int i = 0; i < n; i++) {
            c += primeCheck(scn.nextInt());
        }
        System.out.println(c);
    }
    
    private static int primeCheck(int x) {
        int rslt = 1;
        if(x < 2 || x > 3 && x % 2 == 0) {
            rslt = 0;
        }
        for(int i = 3; i <= x / i; i += 2) {
            if(x % i == 0) {
                rslt = 0;
                break;
            }
        }
        return rslt;
    }
}