using System;
using System.Linq;
using static System.Console;

namespace AOJ
{
    public class ALDS1_1_C
    {
        public static void Main(string[] args)
        {
            int N = int.Parse(ReadLine());
            var A = new int[N];
            for (int i = 0; i < N; i++)
            {
                A[i] = int.Parse(ReadLine());
            }

            int cnt = 0;
            for (int i = 0; i < N; i++)
            {
                if (IsPrime(A[i]))
                {
                    cnt++;
                }
            }
            
            WriteLine(cnt);
        }

        public static bool IsPrime(int x)
        {
            if (x <= 1) return false;

            int y = x - 1;
            while(y > 1)
            {
                if (x % y == 0) return false;
                y--;
            }

            return true;
        }
    }
}
