
import java.util.Scanner;

/**
 * Created by ??\??? on 2016/12/2.
 */
public class Main {
    static boolean[] tony(int n)
    {
        boolean[] array = new boolean[n];
        for(int i = 0;i<n;i++)
        {
            array[i] = true;
        }
        array[0] = false;
        array[1] = false;
        for(int i = 2;i<= Math.sqrt((double)n);i++)
        {
            if(array[i]) {
                int j = i + i;
                while (j < n) {
                    array[j] = false;
                    j = j + i;
                }
            }
        }
        return array;
    }
    static int run(String[] args)
    {
        boolean[] tony = tony(100000000);
        Scanner scan = new Scanner(System.in);
        while(scan.hasNext()) {
            int T = Integer.parseInt(scan.nextLine());
            int ans = 0;
            for (int i = 0; i < T; i++) {
                if (tony[scan.nextInt()])
                    ans++;
            }
            System.out.println(ans);
        }
        return 0;
    }

    public static void main(String[] args)
    {
        run(args);
    }
} import java.util.Scanner; Scanner java.util public class Main {
    static boolean[] tony(int n)
    {
        boolean[] array = new boolean[n];
        for(int i = 0;i<n;i++)
        {
            array[i] = true;
        }
        array[0] = false;
        array[1] = false;
        for(int i = 2;i<= Math.sqrt((double)n);i++)
        {
            if(array[i]) {
                int j = i + i;
                while (j < n) {
                    array[j] = false;
                    j = j + i;
                }
            }
        }
        return array;
    }
    static int run(String[] args)
    {
        boolean[] tony = tony(100000000);
        Scanner scan = new Scanner(System.in);
        while(scan.hasNext()) {
            int T = Integer.parseInt(scan.nextLine());
            int ans = 0;
            for (int i = 0; i < T; i++) {
                if (tony[scan.nextInt()])
                    ans++;
            }
            System.out.println(ans);
        }
        return 0;
    }

    public static void main(String[] args)
    {
        run(args);
    }
} Main static boolean[] tony(int n)
    {
        boolean[] array = new boolean[n];
        for(int i = 0;i<n;i++)
        {
            array[i] = true;
        }
        array[0] = false;
        array[1] = false;
        for(int i = 2;i<= Math.sqrt((double)n);i++)
        {
            if(array[i]) {
                int j = i + i;
                while (j < n) {
                    array[j] = false;
                    j = j + i;
                }
            }
        }
        return array;
    } tony {
        boolean[] array = new boolean[n];
        for(int i = 0;i<n;i++)
        {
            array[i] = true;
        }
        array[0] = false;
        array[1] = false;
        for(int i = 2;i<= Math.sqrt((double)n);i++)
        {
            if(array[i]) {
                int j = i + i;
                while (j < n) {
                    array[j] = false;
                    j = j + i;
                }
            }
        }
        return array;
    } boolean[] array = new boolean[n]; array new boolean[n] n for(int i = 0;i<n;i++)
        {
            array[i] = true;
        } int i = 0; int i = 0; i 0 i<n i n i++ i++ i {
            array[i] = true;
        } {
            array[i] = true;
        } array[i] = true array[i] array i true array[0] = false array[0] array 0 false array[1] = false array[1] array 1 false for(int i = 2;i<= Math.sqrt((double)n);i++)
        {
            if(array[i]) {
                int j = i + i;
                while (j < n) {
                    array[j] = false;
                    j = j + i;
                }
            }
        } int i = 2; int i = 2; i 2 i<= Math.sqrt((double)n) i Math.sqrt((double)n) Math.sqrt Math (double)n i++ i++ i {
            if(array[i]) {
                int j = i + i;
                while (j < n) {
                    array[j] = false;
                    j = j + i;
                }
            }
        } {
            if(array[i]) {
                int j = i + i;
                while (j < n) {
                    array[j] = false;
                    j = j + i;
                }
            }
        } if(array[i]) {
                int j = i + i;
                while (j < n) {
                    array[j] = false;
                    j = j + i;
                }
            } array[i] array i {
                int j = i + i;
                while (j < n) {
                    array[j] = false;
                    j = j + i;
                }
            } int j = i + i; j i + i i i while (j < n) {
                    array[j] = false;
                    j = j + i;
                } j < n j n {
                    array[j] = false;
                    j = j + i;
                } array[j] = false array[j] array j false j = j + i j j + i j i return array; array int n n static int run(String[] args)
    {
        boolean[] tony = tony(100000000);
        Scanner scan = new Scanner(System.in);
        while(scan.hasNext()) {
            int T = Integer.parseInt(scan.nextLine());
            int ans = 0;
            for (int i = 0; i < T; i++) {
                if (tony[scan.nextInt()])
                    ans++;
            }
            System.out.println(ans);
        }
        return 0;
    } run {
        boolean[] tony = tony(100000000);
        Scanner scan = new Scanner(System.in);
        while(scan.hasNext()) {
            int T = Integer.parseInt(scan.nextLine());
            int ans = 0;
            for (int i = 0; i < T; i++) {
                if (tony[scan.nextInt()])
                    ans++;
            }
            System.out.println(ans);
        }
        return 0;
    } boolean[] tony = tony(100000000); tony tony(100000000) tony 100000000 Scanner scan = new Scanner(System.in); scan new Scanner(System.in) while(scan.hasNext()) {
            int T = Integer.parseInt(scan.nextLine());
            int ans = 0;
            for (int i = 0; i < T; i++) {
                if (tony[scan.nextInt()])
                    ans++;
            }
            System.out.println(ans);
        } scan.hasNext() scan.hasNext scan {
            int T = Integer.parseInt(scan.nextLine());
            int ans = 0;
            for (int i = 0; i < T; i++) {
                if (tony[scan.nextInt()])
                    ans++;
            }
            System.out.println(ans);
        } int T = Integer.parseInt(scan.nextLine()); T Integer.parseInt(scan.nextLine()) Integer.parseInt Integer scan.nextLine() scan.nextLine scan int ans = 0; ans 0 for (int i = 0; i < T; i++) {
                if (tony[scan.nextInt()])
                    ans++;
            } int i = 0; int i = 0; i 0 i < T i T i++ i++ i {
                if (tony[scan.nextInt()])
                    ans++;
            } {
                if (tony[scan.nextInt()])
                    ans++;
            } if (tony[scan.nextInt()])
                    ans++; tony[scan.nextInt()] tony scan.nextInt() scan.nextInt scan ans++ ans System.out.println(ans) System.out.println System.out System System.out ans return 0; 0 String[] args args public static void main(String[] args)
    {
        run(args);
    } main {
        run(args);
    } run(args) run args String[] args args public class Main {
    static boolean[] tony(int n)
    {
        boolean[] array = new boolean[n];
        for(int i = 0;i<n;i++)
        {
            array[i] = true;
        }
        array[0] = false;
        array[1] = false;
        for(int i = 2;i<= Math.sqrt((double)n);i++)
        {
            if(array[i]) {
                int j = i + i;
                while (j < n) {
                    array[j] = false;
                    j = j + i;
                }
            }
        }
        return array;
    }
    static int run(String[] args)
    {
        boolean[] tony = tony(100000000);
        Scanner scan = new Scanner(System.in);
        while(scan.hasNext()) {
            int T = Integer.parseInt(scan.nextLine());
            int ans = 0;
            for (int i = 0; i < T; i++) {
                if (tony[scan.nextInt()])
                    ans++;
            }
            System.out.println(ans);
        }
        return 0;
    }

    public static void main(String[] args)
    {
        run(args);
    }
} public class Main {
    static boolean[] tony(int n)
    {
        boolean[] array = new boolean[n];
        for(int i = 0;i<n;i++)
        {
            array[i] = true;
        }
        array[0] = false;
        array[1] = false;
        for(int i = 2;i<= Math.sqrt((double)n);i++)
        {
            if(array[i]) {
                int j = i + i;
                while (j < n) {
                    array[j] = false;
                    j = j + i;
                }
            }
        }
        return array;
    }
    static int run(String[] args)
    {
        boolean[] tony = tony(100000000);
        Scanner scan = new Scanner(System.in);
        while(scan.hasNext()) {
            int T = Integer.parseInt(scan.nextLine());
            int ans = 0;
            for (int i = 0; i < T; i++) {
                if (tony[scan.nextInt()])
                    ans++;
            }
            System.out.println(ans);
        }
        return 0;
    }

    public static void main(String[] args)
    {
        run(args);
    }
} Main

import java.util.Scanner;

/**
 * Created by ??\??? on 2016/12/2.
 */
public class Main {
    static boolean[] tony(int n)
    {
        boolean[] array = new boolean[n];
        for(int i = 0;i<n;i++)
        {
            array[i] = true;
        }
        array[0] = false;
        array[1] = false;
        for(int i = 2;i<= Math.sqrt((double)n);i++)
        {
            if(array[i]) {
                int j = i + i;
                while (j < n) {
                    array[j] = false;
                    j = j + i;
                }
            }
        }
        return array;
    }
    static int run(String[] args)
    {
        boolean[] tony = tony(100000000);
        Scanner scan = new Scanner(System.in);
        while(scan.hasNext()) {
            int T = Integer.parseInt(scan.nextLine());
            int ans = 0;
            for (int i = 0; i < T; i++) {
                if (tony[scan.nextInt()])
                    ans++;
            }
            System.out.println(ans);
        }
        return 0;
    }

    public static void main(String[] args)
    {
        run(args);
    }
}