using System;
using System.Collections.Generic;
using System.Linq;

namespace ALDS1_1_C
{
    class Program
    {
        static void Main(string[] args)
        {
            int ans = 0;
            while (true)
            {
                bool flag = false;
                string gh = Console.ReadLine();
                if (gh == null) { break; }
                int a = int.Parse(gh);
                if (a == 1||a==2) { }
                else if (a % 2 != 0)                
                {
                    for(int i = 3; i < a; i += 2)
                    {
                        if (a % i == 0) { flag = true; break; }

                    }
                    if (flag == false)
                    {
                        ans++;
                    }
                }
            }
        }
    }
}