using System;

class Program
{
    static bool[] isNotPrime = new bool[100000001];
    static bool[] isUsed = new bool[100000001];
    static void Main()
    {
        isNotPrime[1] = true;
        for (int i = 2; i < 10000001; i++)
        {
            if (isNotPrime[i]) continue;
            for (int j = 2; j * i < 10000001; j++) isNotPrime[j * i] = true;
        }
        int counter = 0;
        while (true)
        {
            string raw = Console.ReadLine();
            if (raw == null) break;
            int input = int.Parse(raw);
            if (!isNotPrime[input] && !isUsed[input])
            {
                counter++;
                isUsed[input] = true;
            }
        }
        Console.WriteLine(counter);
        return;
    }
}