A number is called almost prime if it has exactly two distinct prime divisors. For example, numbers 6, 18, 24 are almost prime, while 4, 8, 9, 42 are not. Find the amount of almost prime numbers which are between 1 and n, inclusive.

Input contains one integer number n (1 ≤ n ≤ 3000).

Output the amount of almost prime numbers between 1 and n, inclusive.

using System;
using System.Collections.Generic;

namespace Task26A
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            List<int> primeNumbers = new List<int>();
            for (int i = 1; i <= n; i++)
                if (IsPrime(i))
                    primeNumbers.Add(i);

            int ans = 0;
            for (int i = 1; i <= n; i++)
                if (IsAlmostPrime(ref primeNumbers, i))
                    ans++;

            Console.WriteLine(ans);
           // Console.ReadKey();
        }

        private static bool IsPrime(int N)
        {
            if (N < 2)
                return false;
            if (N == 2)
                return true;
            if (N % 2 == 0)
                return false;

            for (int i = 3; i <= Math.Sqrt(N); i++)
                if (N % i == 0)
                    return false;

            return true;
        }

        private static bool IsAlmostPrime(ref List<int>primes, int N) {
            int count = 0;
            for (int i = 0; i < primes.Count; i++)
            {
                if (N % primes[i] == 0)
                    count++;
                if (primes[i] > N / 2)
                    break;
            }
            return count == 2;
        }

    }
}

using System;
namespace codeforces
{
    class Program
    {
        static void Main(string[] args)
        {
            int t = int.Parse(Console.ReadLine());
            int count = 0;
            for (int i = 6; i <= t; i++)
            {
                int c = 0;
                bool flag = false;
                for (int k = 2; k <= i / 2; k++)
                {
                    flag = true;
                    if (i % k == 0)
                    {
                        flag = false;
                        for (int j = 2; j <= k / 2; j++)
                        {
                            if (k % j == 0)
                            {
                                flag = true;
                                break;
                            }
                        }
                    }
                    c += flag ? 0 : 1;
                }
                count += c == 2 ? 1 : 0;
            }
            Console.WriteLine(count);
        }
    }
}

using System;
class Test {
    public static void Main(){
        int n = Int32.Parse(Console.ReadLine());
        int [] aP = new int[n];
        aP[0] = 2;
        int k = 1;
        for(int i = 0 ; i<= n ; i++){
            for(int j = 2 ; j< i ; j++){
                if( i%j == 0 ){
                    break;
                }
                if(j == i-1){
                    aP[k] = i;
                    k++;
                }
            }
        }
        int m = Array.IndexOf(aP,0);
        int ans = 0;
        for(int a = 6 ; a <= n ; a++ ){
           int num = 0;
           for(int b = 0 ; b<m ; b++){
               if(a%aP[b] == 0){
                   if(num >= 3){
                       b = m;
                       break;
                   }
                   num++;
               }
               if(b == m-1 && num == 2 ){
                   ans++;
               }
           }

        }
        Console.WriteLine(ans);
    }
}

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

namespace ProgrammingContest.Codeforces.Round26
{
    class A
    {
        static bool[] ps = new bool[3001];
        static bool p(int n)
        {
            int m = 0;
            for (int i = 2; i < n; i++ ) if(!ps[i] && n%i==0)m++;
            return m == 2;
        }

        public static void Main()
        {
            ps[0] = ps[1] = true;
            for (int i = 2; i < 3000; i++)
                if (!ps[i]) for (int j = i+i; j < 3001; j += i) ps[j] = true;
            int n = int.Parse(Console.ReadLine());
            int ret = 0;
            for (int i = 1; i <= n; i++)
                if (p(i)) ret++;
            Console.WriteLine(ret);
        }
    }
}

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

namespace CodeForce
{
    class _26a
    {
        public static void Main()
        {
            var primes = new List<int>();
            primes.AddRange(new[] {2, 3, 5});
            for (var i = 5; i <= 3000; i++)
            {
                if (primes.All(prime => i%prime != 0))
                {
                    primes.Add(i);
                }
            }
            var almost = new bool[3010];
            for (var i = 0; i < primes.Count; i++)
            {
                for (var j = i + 1; j < primes.Count; j++)
                {
                    if (primes[i] * primes[j] > 3000)
                    {
                        break;
                    }
                    var number = 1;
                    for (var k = 1; k < 1000; k++)
                    {
                        number *= primes[i];
                        if (number > 3000)
                        {
                            break;
                        }
                        var qq = number;
                        for (var m = 1; m < 1000; m++)
                        {
                            qq *= primes[j];
                            if (qq <= 3000)
                            {
                                almost[qq] = true;
                            }
                            else
                            {
                                break;
                            }
                        }
                    }
                }
            }
            var line = Console.ReadLine();
            var n = int.Parse(line);
            var count = 0;
            for (var i = 0; i <= n; i++)
            {
                if (almost[i])
                {
                    count++;
                }
            }
            Console.WriteLine(count);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Threading;
using System.Numerics;
using System.Globalization;

namespace JalalHani
{
    class Vertex
    {
        public List<int> relations = new List<int>();
        public List<int> weights = new List<int>();
        public Vertex(int r , int w)
        {
            this.relations.Add(r);
            this.weights.Add(w);
        }
        public void AddInfo (int r, int w)
        {
            this.relations.Add(r);
            this.weights.Add(w);
        }
        ////Dijkstra
        //int[] data = Console.ReadLine().Split().Select(s => int.Parse(s)).ToArray();
        //int n = data[0], m = data[1];
        //Dictionary<int, Vertex> Edges = new Dictionary<int, Vertex>();
        //for (int i = 0; i < m; i++)
        //{
        //    data = Console.ReadLine().Split().Select(s => int.Parse(s)).ToArray();
        //    int k = data[0], r = data[1], w = data[2];
        //    if (Edges.Keys.Contains(k))
        //    {
        //        Edges[k].AddInfo(r,w);
        //    }
        //    else
        //    {
        //        Edges.Add(k, new Vertex(r, w));
        //    }
        //}

        //foreach (var edge in Edges)
        //{

        //}
    }

    class Program
    {

        public static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            List<int> values = new List<int>();
            long o = 0;

            for (int i = 6; i <= n; i++)
            {
                double t = (double)i/2;
                t = Math.Ceiling(t) - 1;
                var y = Enumerable.Range(2, (int)t).Where(x => i % x == 0).ToArray();
               // Console.WriteLine(i + " : " + string.Join(" " , y));
                if (y.Count() > 1)
                {
                    if (y.Where(x=>IsPrime(x)).Count() == 2)
                    {
                        values.Add(i);
                    }
                }
            }

            Console.WriteLine(values.Count);
        }

        static bool IsPrime (int i)
        {
            if (i < 4) return true;
            for (int j = 2; j <= (int)Math.Ceiling(Math.Sqrt(i)); j++)
            {
                if (i % j == 0)
                    return false;
            }
            return true;
        }

        static int Test(int v , int m)
        {
            int p1 = 0;
            int dif = (int)Math.Ceiling((double)m / v);
            int diff = v * dif;
            p1 = (diff - m);
            p1 += dif == 2 ? 1 : dif;

            return p1;
        }

        static void MulticasesQuestion()
        {
            int t = int.Parse(Console.ReadLine());
            for (int i = 0; i < t; i++)
                SolveTestCase();
        }
        static void SolveTestCase()
        {

        }
        static int GCD(int a1, int a2)
        {
            int mx = Math.Max(a1, a2);
            int mn = Math.Min(a1, a2);

            if (mx % mn == 0)
            {
                return mn;
            }
            else GCD(mn, mx % mn);
            return 1;
        }

        static BigInteger Pow(int b, int a)
        {
            BigInteger x = 1;

            for (int i = 0; i < a; i++)
            {
                x *= b;
            }

            return x;
        }
        static void LeastCostBracketSequence()
        {
            var input = Console.ReadLine().ToCharArray();
            var isSolutionExists = true;
            long totalCost = 0;
            var balance = 0;

            var sortedVariants = new List<Variant>();
            var comparer = new ByCostSwitch();

            for (var i = 0; i < input.Length; i++)
            {
                if (input[i] == '(')
                {
                    balance++;
                }
                else if (input[i] == ')')
                {
                    balance--;
                }
                else
                {
                    var costValue = Console.ReadLine().Split(' ').Select(a => int.Parse(a)).ToArray();
                    var variant = new Variant()
                    {
                        CostSwitch = costValue[0] - costValue[1],
                        Position = i
                    };

                    var index = sortedVariants.BinarySearch(variant, comparer);
                    if (index < 0)
                    {
                        index = ~index;
                    }

                    sortedVariants.Insert(index, variant);

                    totalCost += costValue[1];
                    balance--;
                }

                if (balance < 0)
                {
                    if (sortedVariants.Count == 0)
                    {
                        isSolutionExists = false;
                        break;
                    }

                    var sortedVariant = sortedVariants[0];

                    input[sortedVariant.Position] = '(';
                    totalCost += sortedVariant.CostSwitch;
                    balance += 2;
                    sortedVariants.RemoveAt(0);
                }
            }

            isSolutionExists = (balance == 0);

            if (isSolutionExists)
            {
                Console.WriteLine(totalCost);
                for (var i = 0; i < input.Length; i++)
                {
                    if (input[i] == '?')
                    {
                        Console.Write(')');
                    }
                    else
                    {
                        Console.Write(input[i]);
                    }
                }
                Console.WriteLine();
            }
            else
            {
                Console.WriteLine("-1");
            }
        }
        class Commands
        {
            public static int[] NextIntArray
            {
                get
                {
                    return Console.ReadLine().Split().Select(int.Parse).ToArray();
                }
            }
            public static List<int> NextIntList
            {
                get
                {
                    return Console.ReadLine().Split().Select(int.Parse).ToList();
                }
            }
            public static int[] NextSortedIntArray
            {
                get
                {
                    return Console.ReadLine().Split().Select(int.Parse).OrderBy(x => x).ToArray();
                }
            }
            public static int[] NextDescSortedIntArray
            {
                get
                {
                    return Console.ReadLine().Split().Select(int.Parse).OrderByDescending(x => x).ToArray();
                }
            }
            public static long[] NextLongArray
            {
                get
                {
                    return Console.ReadLine().Split().Select(long.Parse).ToArray();
                }
            }
            public static List<long> NextLongList
            {
                get
                {
                    return Console.ReadLine().Split().Select(long.Parse).ToList();
                }
            }
            public static long[] NextSortedLongArray
            {
                get
                {
                    return Console.ReadLine().Split().Select(long.Parse).OrderBy(x => x).ToArray();
                }
            }
            public static long[] NextDescSortedLongArray
            {
                get
                {
                    return Console.ReadLine().Split().Select(long.Parse).OrderByDescending(x => x).ToArray();
                }
            }
            public static int NextInt
            {
                get
                {
                    return int.Parse(Console.ReadLine());
                }
            }

            public static string NextString
            {
                get { return Console.ReadLine(); }
            }
        }

        private class Variant
        {
            public int CostSwitch;
            public int Position;
        }

        private class ByCostSwitch : IComparer<Variant>
        {
            #region IComparer implementation
            public int Compare(Variant x, Variant y)
            {
                return x.CostSwitch.CompareTo(y.CostSwitch);
            }
            #endregion
        }
    }
}

using System;

namespace _26A
{
    class Program
    {

      static  bool IsPrime(int num)
        {
            if (num == 2) return true;
            if (num < 2 || num % 2 == 0) return false;
            int limit = (int)Math.Sqrt(num);
            for (int i = 3; i <= limit; i += 2)
                if (num % i == 0)
                    return false;

            return true;
        }

      static  bool AlmostPrime(int num)
        {
            int counter = 0;
            for (int i = 2; i <= num / 2; i++)
            {
                if (num % i == 0 && IsPrime(i)) counter++;
            }
            return counter == 2;
        }

        static void Main(string[] args)
        {
            int n=int.Parse(Console.ReadLine());
            int answer = 0;
            for (int i = 1; i <= n; i++)
                if (AlmostPrime(i)) answer++;

            Console.WriteLine(answer);

        }
    }
}

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

namespace CSharp
{
    public class _26A
    {
        public static void Main()
        {
            int n = int.Parse(Console.ReadLine());

            var primes = new SortedSet<int>();
            for (int i = 2; i <= n; i++)
            {
                bool isPrime = true;

                foreach (int p in primes)
                {
                    if (i % p == 0)
                    {
                        isPrime = false;
                        break;
                    }
                }

                if (isPrime)
                {
                    primes.Add(i);
                }
            }

            Console.WriteLine(Enumerable.Range(1, n).Count(i => primes.Count(p => i % p == 0) == 2));
        }
    }
}

using System;
using System.Text;
class AlmostPrime
{
    public static int almostPrime(int n)
    {
        bool[] primes = new bool[n + 1];
        int[] count = new int[n + 1];
        for (int i = 2; i <= n; i++)
        {
            primes[i] = true;
        }
        for (int i = 2; i  <= n/2; i++)
        {
            if (primes[i])
            {
                for (int j = 2; i * j <= n; j++)
                {
                    primes[i * j] = false;
                    count[i * j]++;
                }
            }
        }
        int ans = 0;
        for (int i = 0; i <= n; i++)
        {
            if (count[i] == 2)
            {
                ans++;
            }
        }
        return ans;
    }
    static public void Main () {
        int n = Convert.ToInt32(Console.ReadLine());
        int res = almostPrime(n);
        Console.WriteLine(res);
	}
}

using System;

namespace test
{
  class Program
  {
    static void Main(string[] args)
    {
      int n = int.Parse(Console.ReadLine());

      int[] nums = new int[n + 1];
      for (int i = 2; i <= n; i++)
        if(nums[i] == 0)
          for (int j = i + i; j <= n; j += i)
            nums[j]++;

      int count = 0;
      for (int i = 0; i < nums.Length; i++)
        if (nums[i] == 2)
          count++;

      Console.Write(count);
    }
  }
}

using System;
using System.IO;
using System.Collections;
using System.Collections.Generic;

class Program
{
  class Pair : System.IComparable
  {
    public int x;
    public int y;

    public Pair(int xx, int yy)
    {
      x = xx;
      y = yy;
    }

    public int CompareTo(object obj)
    {
      Pair p = (Pair)obj;
      return x < p.x ? -1 : x == p.x ? 0 : 1;
    }
  }

  static int[] GetInts()
  {
    string[] ss = GetStrs();
    int[] nums = new int[ss.Length];

    int i = 0;
    foreach (string s in ss)
      nums[i++] = GetInt(s);

    return nums;
  }

  static string[] GetStrs()
  {
    return Console.ReadLine().Split(new char[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);
  }

  static int GetInt(string s)
  {
    return int.Parse(s);
  }

  static long GetLong(string s)
  {
    return long.Parse(s);
  }

  static int GetInt()
  {
    return int.Parse(GetStr());
  }

  static long GetLong()
  {
    return long.Parse(GetStr());
  }

  static string GetStr()
  {
    return Console.ReadLine();
  }

  static void WL(String s)
  {
    Console.WriteLine(s);
  }

  static void WL(long s)
  {
    Console.WriteLine(s);
  }

  static void W(String s)
  {
    Console.Write(s);
  }

  static void W(long s)
  {
    Console.Write(s);
  }

  static void Main(string[] args)
  {
    int[] t = GetInts();

    bool[] p = new bool[3000];
    for (int i = 2; i < 3000; ++i)
      p[i] = true;

    for (int i = 2; i < 3000; ++i)
    {
      for (int j = 2*i; j < 3000; j += i)
        p[j] = false;
    }

    int n = t[0];
    int a = 0;
    for (int i = 2; i <= n; ++i)
    {
      int c = 0;
      for (int j = 2; j < i; ++j)
      {
        if (p[j] && i % j == 0) ++c;
      }
      if (c == 2)
        ++a;
    }
    W(a);

#if !ONLINE_JUDGE
    Console.ReadLine();
#endif
  }
}

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

namespace Task_26A
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());

            int ans = 0;
           List<int> primeNumbers = new List<int>();
            for (int i = 2; i <= n; i++)
            {
                if (isPrime(i))
                    primeNumbers.Add(i);
            }
            for (int i = 1; i <= n; i++)
                if (isAlmoastPrime(ref primeNumbers, i))
                    ans++;

            Console.WriteLine(ans);
            //Console.ReadKey();

        }

        private static bool isPrime(int number)
        {
            if (number == 2)
                return true;
            if (number % 2 == 0 || number < 2)
                return false;

            for (int i = 3; i <= Math.Sqrt(number); i += 2)
                if (number % i == 0)
                    return false;

            return true;
        }
        private static bool isAlmoastPrime(ref List<int> Primes, int item)
        {
            int count = 0;
            for (int i = 0; i < Primes.Count; i++)
            {
                if (item %  Primes[i] == 0)
                    count++;
                if (count > 2)
                    return false;
            }

            return count == 2;
        }
    }

    }

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

namespace Task_26A
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());

            int ans = 0;
           ArrayList primeNumbers = new ArrayList();
            for (int i = 2; i <= n; i++)
            {
                if (isPrime(i))
                    primeNumbers.Add(i);
            }
            for (int i = 1; i <= n; i++)
                if (isAlmoastPrime(primeNumbers, i))
                    ans++;

            Console.WriteLine(ans);

        }

        private static bool isPrime(int number)
        {
            if (number == 2)
                return true;
            if (number % 2 == 0 || number < 2)
                return false;

            for (int i = 3; i <= Math.Sqrt(number); i += 2)
                if (number % i == 0)
                    return false;

            return true;
        }
        private static bool isAlmoastPrime(ArrayList Primes, int item)
        {
            int count = 0;
            for (int i = 0; i < Primes.Count; i++)
            {
                if (item % (int) Primes[i] == 0)
                    count++;
                if (count > 2)
                    return false;
            }

            return count == 2;
        }
    }

    }

using System;
using System.Collections.Generic;
using System.Text;

namespace CodeForcesApp
{
    class A
    {
        static List<int> primes = new List<int>();

        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            primes = BuildPrimes(n + 1);

            int total = 0;
            for (int x = 1; x <= n; x++)
            {
                Dictionary<int, int> f = Factorize(x);

                //string res = "";
                //foreach (var it in f)
                //{
                //    res += it.Key + "^" + it.Value + " + ";
                //}

                //Console.WriteLine(x + " = " + res);

                if (f.Count == 2)
                {
                    total++;
                }
            }
            Console.WriteLine(total);
        }

        public static List<int> BuildPrimes(long n)
        {
            List<int> p = new List<int>();
            if (n > 2) p.Add(2);

            for (int i = 3; i <= n; i += 2)
            {
                bool prime = true;
                for (int j = 0; p[j] * p[j] <= i; j++)
                {
                    if (i % p[j] == 0)
                    {
                        prime = false;
                        break;
                    }
                }
                if (prime)
                    p.Add(i);
            }
            return p;
        }

        public static Dictionary<int, int> Factorize(int n)
        {
            Dictionary<int, int> d = new Dictionary<int, int>();

            while (n > 1)
            {
                bool changed = false;
                foreach (int p in primes)
                {
                    while (n % p == 0)
                    {
                        if (d.ContainsKey(p))
                            d[p]++;
                        else
                            d.Add(p, 1);
                        n /= p;
                        changed = true;
                    }
                }
                if (!changed && n > 1)
                {
                    d.Add(n, 1);
                    n = 1;
                }
            }

            return d;
        }

    }
}

//#define TEST
#if TEST
using System.IO;
#endif

using System;
using System.Text;

namespace CF
{
    #region Start
#if !TEST
    using cin = Console;
    using cout = Console;
#endif
#endregion
    class Program
    {
        static void Main(string[] args)
        {
            #region BEGIN
            #if TEST
            string filepath = @"E:\Projects 2010\CF55\B\";
            FileStream file = new FileStream(String.Concat(filepath, @"input.txt"), FileMode.Open, FileAccess.Read);
            StreamReader cin = new StreamReader(file);
            FileStream fileOut = new FileStream(String.Concat(filepath, @"output.txt"), FileMode.Truncate, FileAccess.Write);
            StreamWriter cout = new StreamWriter(fileOut, System.Text.Encoding.Unicode);
            #endif
            try
            {
            #endregion
                int n = int.Parse(cin.ReadLine());
                int[] pr = new int[n];
                int N=0;
                for(int i=2;i<n;i++)
                {
                    int s=0;
                    for(int j=2;j<i;j++)
                        if(i%j==0)s++;
                    if (s == 0) { pr[N] = i; N++; }
                }
                int S = 0;
                for (int j = 2; j <= n; j++)
                {
                    int ans = 0;
                    for (int i = 0; i < N; i++)
                    {
                        if (j % pr[i] == 0) ans++;
                    }
                    if (ans == 2) S++;
                }
                cout.WriteLine(S);
            #region END
            }

            catch (Exception e)
            {
                #if TEST
                cout.WriteLine(e.Message);
                cout.WriteLine("----------------------");
                cout.WriteLine(e.StackTrace);
                #endif
            }
            finally
            {
                #if TEST
                cout.Close();
                cin.Close();
                fileOut.Close();
                file.Close();
                #endif
            }
            #endregion
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using static System.Console;
using static System.Convert;
using static System.Math;
//using Debug;
//using static System.Globalization.CultureInfo;
//using Edge = Pair<long, int>;
using System.Text;
class Program
{
    static void Main(string[] args)
    {
        Solve();
        //WriteLine(Solve());
    }
    static void Solve()
    {
        var num = Input.num;
        var ct = new int[num+1];
        for (var i = 2; i <= num; i++)
            if (ct[i] == 0)
                for (var j = i; j <= num; j += i)
                    ct[j]++;
        WriteLine(ct.Count(v => v == 2));
    }
}

public class Input
{
    public static string read => ReadLine().Trim();
    public static int[] ar => read.Split(' ').Select(int.Parse).ToArray();
    public  static int num => ToInt32(read);
    public static long[] arL => read.Split(' ').Select(long.Parse).ToArray();
    public  static long numL => ToInt64(read);
    public static char[][] gred(int h)
        => Enumerable.Repeat(0, h).Select(_ => read.ToCharArray()).ToArray();
    public static int[] ar1D(int n)
        => Enumerable.Repeat(0, n).Select(_ => num).ToArray();
    public static long[] arL1D(int n)
        => Enumerable.Repeat(0, n).Select(_ => numL).ToArray();
    public static string[] strs(int n)
        => Enumerable.Repeat(0, n).Select(_ => read).ToArray();
    public static int[][] ar2D(int n)
        => Enumerable.Repeat(0, n).Select(_ => ar).ToArray();
    public static long[][] arL2D(int n)
        => Enumerable.Repeat(0, n).Select(_ => arL).ToArray();
    public static T getValue<T>(string g)
    {
        var t = typeof(T);
        if (t == typeof(int))
            return (T)(object)int.Parse(g);
        if (t == typeof(long))
            return (T)(object)long.Parse(g);
        if (t == typeof(string))
            return (T)(object)g;
        if (t == typeof(char))
            return (T)(object)char.Parse(g);
        if (t == typeof(double))
            return (T)(object)double.Parse(g);
        if (t == typeof(bool))
            return (T)(object)bool.Parse(g);
        return default(T);
    }
    public const long Inf = (long)1e18;
    public const double eps = 1e-6;
    public  const string Alfa = "abcdefghijklmnopqrstuvwxyz";
    public  const int MOD = 1000000007;
}

using System;
using System.Collections.Generic;
using System.Globalization;
using System.Text;
using System.IO;

class Program
{

    void solve()
    {
        int ret = 0;
        int n = nextInt();
        for (int i = 2; i <= n; i++)
            if (ok(i))
                ret++;
        println(ret);
    }

    private bool ok(int n)
    {
        int cnt = 0;
        for(int i=2;i*i<=n;i++)
            if (n % i == 0)
            {
                cnt++;
                while (n % i == 0)
                {
                    n /= i;
                }
            }
        if (n > 1)
            cnt++;
        return cnt == 2;
    }
    ////////////
    private void println(string Stringst)
    {
        Console.WriteLine(Stringst);
    }
    private void println(char charnum)
    {
        Console.WriteLine(charnum);
    }
    private void println(int Intnum)
    {
        Console.WriteLine(Intnum);
    }
    private void println(long Longnum)
    {
        Console.WriteLine(Longnum);
    }
    private void println(double Doublenum)
    {
        Console.WriteLine(Doublenum);
    }

    private void print(string Stringst)
    {
        Console.Write(Stringst);
    }
    private void print(int Intnum)
    {
        Console.Write(Intnum);
    }
    private void print(char charnum)
    {
        Console.Write(charnum);
    }
    private void print(long Longnum)
    {
        Console.Write(Longnum);
    }
    private void print(double Doublenum)
    {
        Console.Write(Doublenum);
    }

    string[] inputLine = new string[0];
    int inputInd = 0;
    string nextLine()
    {
        return Console.ReadLine();
    }
    void readInput()
    {
        if (inputInd != inputLine.Length)
            throw new Exception();
        inputInd = 0;
        inputLine = Console.ReadLine().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
        if (inputLine.Length == 0)
            readInput();

    }
    int nextInt()
    {
        if (inputInd == inputLine.Length)
            readInput();
        return int.Parse(inputLine[inputInd++]);
    }
    long nextLong()
    {
        if (inputInd == inputLine.Length)
            readInput();
        return long.Parse(inputLine[inputInd++]);
    }
    double nextDouble()
    {
        if (inputInd == inputLine.Length)
            readInput();
        return double.Parse(inputLine[inputInd++]);
    }
    string nextString()
    {
        if (inputInd == inputLine.Length)
            readInput();
        return inputLine[inputInd++];
    }
    static void Main(string[] args)
    {
        new Program().solve();
    }
}

using System;
using System.Collections.Generic;
using System.Text;
using System.Diagnostics;

namespace codeforces
{
    class C
    {
        static CodeforcesUtils CF = new CodeforcesUtils(
@"
21
");

        static void Main(string[] args)
        {
            int n = int.Parse(CF.ReadLine());

            List<int> ap = new List<int>();
            {
                List<int> ps = _p(n);
                for (int p1 = 0; p1 < ps.Count; p1++)
                {
                    for (int p2 = p1 + 1; p2 < ps.Count; p2++)
                    {
                        int n1 = 1;
                        for (int c1 = 1; ; c1++)
                        {
                            n1*= ps[p1];
                            if (n1 > n)
                                break;

                            int n1n2 = n1;

                            for(int c2 = 1;;c2++)
                            {
                                n1n2*=ps[p2];
                                if( n1n2 > n )
                                    break;
                                ap.Add(n1n2);
                            }
                        }
                    }
                }
            }
            CF.WriteLine(ap.Count);
        }

        static List<int> _p(int n)
        {
            if (n < 2)
                return new List<int>();

            List<int>s = new List<int>();
            for (int i = 2; i <= n; i ++)
                s.Add(i);

            List<int> ps = new List<int>();

            for (; ; )
            {
                int p = s[0];
                ps.Add(p);

                List<int> s2 = new List<int>();
                foreach (int i in s)
                {
                    if (i % p != 0)
                        s2.Add(i);
                }
                s = s2;

                if (s.Count == 0 || s[s.Count - 1] * s[s.Count - 1] < ps[ps.Count - 1])
                    break;
            }
            return ps;
        }

        #region test

        class CodeforcesUtils
        {
            public string ReadLine()
            {
#if DEBUG
                if (_lines == null)
                {
                    _lines = new List<string>();
                    string[] ss = _test_input.Replace("\n", "").Split('\r');
                    for (int i = 0; i < ss.Length; i++)
                    {
                        if (
                            (i == 0 || i == ss.Length - 1) &&
                            ss[i].Length == 0
                            )
                            continue;

                        _lines.Add(ss[i]);
                    }
                }

                string s = null;
                if (_lines.Count > 0)
                {
                    s = _lines[0];
                    _lines.RemoveAt(0);
                }
                return s;
#else
            return Console.In.ReadLine();
#endif
            }

            public void WriteLine(object o)
            {
#if DEBUG
                System.Diagnostics.Trace.WriteLine(o);
#else
            Console.WriteLine(o);
#endif
            }

            public void Write(object o)
            {
#if DEBUG
                System.Diagnostics.Trace.Write(o);
#else
            Console.Write(o);
#endif
            }

            public CodeforcesUtils(string test_input)
            {
                _test_input = test_input;
            }

            string _test_input;

            List<string> _lines;
        }

        #endregion
    }
}

using System;
using System.Collections.Generic;
class some
{
	public static void Main()
	{
		int s=Convert.ToInt32(Console.ReadLine());
		List<int> ll=new List<int>();
		ll.Add(2);
		for(int i=3;i<=s;i++)
		{
			int j;bool yea=false;
			for(j=2;j*j<=i;j++)
			{
				if(i%j==0)
				{
					yea=true;break;
				}
			}
			if(!yea)ll.Add(i);
		}
		int cc=0;
		for(int i=1;i<=s;i++)
		{
			int count=0;
			for(int j=0;j<ll.Count;j++)
			{
				if(i%ll[j]==0)count++;
			}
			if(count==2)cc++;
		}
		Console.WriteLine(cc);
	}
}

using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Linq;
using System.IO;
//using System.Numerics;
using System.Globalization;

class Program{
    static void Main(){
        System.Threading.Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
#if !ONLINE_JUDGE
        StreamWriter fout;
        Console.SetIn(new StreamReader("input.txt"));
        Console.SetOut(fout=new StreamWriter("output.txt"));
#endif
        int n = readInt();
        int count = 0;
        HashSet<int> divs = new HashSet<int>();

        for (int i = 2; i <= n; i++)
        {
            int k = 2, j = i;
            while (true) {
                if (j % k == 0)
                {
                    divs.Add(k);
                    j /= k;
                } else k++;

                if (j == 1) break;
            }

            if (divs.Count == 2) count++;
            divs.Clear();
        }

        print(count);

#if !ONLINE_JUDGE
        fout.Close();
#endif
    }

    struct quat<T1, T2, T3, T4> { public T1 fst; public T2 snd; public T3 thr; public T4 frt; }
    struct trip<T1, T2, T3> { public T1 fst; public T2 snd; public T3 thr; }
    struct pair<T1, T2> { public T1 fst; public T2 snd; }
    static long LCM(long a, long b) { return a / GCD(a, b) * b; }
    static long GCD(long a, long b) { if (b == 0) return a; else return GCD(b, a % b); }
    static void swap<T>(ref T a, ref T b) { T tmp = a; a = b; b = tmp; }
    static double dist(double x1, double y1, double x2, double y2) { return Math.Sqrt(Math.Pow(x1-x2, 2)+Math.Pow(y1-y2, 2)); }
    static void fill<T>(T[] d, T v) { for (int i = 0; i < d.Length; i++) d[i] = v; }
    static void fill<T>(T[,] d, T v) { for (int i = 0; i < d.GetLength(0); i++) { for (int j = 0; j < d.GetLength(1); j++) { d[i, j] = v; } } }

    static void print(double v) { Console.Write(v); }
    static void print(long v) { Console.Write(v); }
    static void print(int v) { Console.Write(v); }
    static void print(string v) { Console.Write(v); }
    static void print(char v) { Console.Write(v); }
    //static void print(BigInteger v) { Console.Write(v); }
    static void print(String f, params object[] o) { Console.Write(f, o); }

    static void println(double v) { Console.WriteLine(v); }
    static void println(long v) { Console.WriteLine(v); }
    static void println(int v) { Console.WriteLine(v); }
    static void println(string v) { Console.WriteLine(v); }
    static void println(char v) { Console.WriteLine(v); }
    //static void println(BigInteger v) { Console.WriteLine(v); }
    static void println() { Console.WriteLine(); }
    static void println(String f, params object[] o) { Console.WriteLine(f, o); }

    static string RL() { return Console.ReadLine(); }
    static int[] readValsI(int n) { int[] t = new int[n]; for (int i = 0; i < n; i++) t[i] = readInt(); return t; }
    static double[] readValsD(int n) { double[] t = new double[n]; for (int i = 0; i < n; i++) t[i] = readDouble(); return t; }

    /*static BigInteger readBigInt()
    {
        BigInteger val = 0;
        bool m = false;
        int c;
        while (((c = Console.Read()) < '0' || c > '9') && c != '-') { }
        val = (c >= '0' && c <= '9') ? c - 48 : (c == '-' ? m=true : m=false) ? 0 : 0;
        while ((c = Console.Read() - 48) >= 0 && c <= 9) val = val*10 + (m?-c:c);
        return val;
    }*/

    static double readDouble() {
        bool m = false;
        double val = 0;
        int c = 0, r = 1;
        while(((c=Console.Read())<'0' || c>'9') && c!='-') {}
        val = (c >= '0' && c <= '9') ? c - 48 : (c == '-' ? m=true : m=false) ? 0 : 0;
        while ((c = Console.Read()) >= '0' && c <= '9') val = val * 10 + (m?-(c-48):(c-48));
        if(c=='.') while ((c = Console.Read()) >= '0' && c <= '9'){ val += ((double)(c-48))/(r*=10); }

        return val;
    }

    static long readLong()
    {
        long val = 0;
        bool m = false;
        int c;
        while (((c = Console.Read()) < '0' || c > '9') && c != '-') { }
        val = (c >= '0' && c <= '9') ? c - 48 : (c == '-' ? m=true : m=false) ? 0 : 0;
        while ((c = Console.Read() - 48) >= 0 && c <= 9) val = val*10 + (m?-c:c);
        return val;
    }

    static int readInt()
    {
        bool m = false;
        int val = 0, c;
        while (((c = Console.Read()) < '0' || c > '9') && c != '-') { }
        val = (c >= '0' && c <= '9') ? c - 48 : (c == '-' ? m=true : m=false) ? 0 : 0;
        while ((c = Console.Read() - 48) >= 0 && c <= 9) val = val*10 + (m?-c:c);
        return val;
    }

    static string readLine() {
        string s = "";
        int c;
        while((c=Console.Read())!=10 && c!=-1) s+=(char)c;
        return s;
    }

    static string readString() {
        string s = "";
        int c;
        while ((c = Console.Read()) != 10 && c != 32 && c != -1) s += (char)c;
        return s;
    }
}

using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
public static class BatchSystem {
    public static int printPrimeFactors(int number)
    {
        int ret = 0;
        for (int i = 2; i <= number; i++) // Test for factors > 1
        {
            if (number % i == 0) // It is a factor > 1
            {
                bool prime = true;
                for (int j = 2; j < i; j++) // Test for prime
                {
                    if (i % j == 0) // It is not prime
                        prime = false;
                }
                if (prime)
                    ret++;
            }
        }
        return ret;
    }

    public static void Main()
    {
        int n = int.Parse(Console.ReadLine());
        int cnt = 0;
        for (int i = 2; i <= n; i++)
            if (printPrimeFactors(i) == 2)
                cnt++;
        Console.WriteLine(cnt);
        return;
    }
}

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

namespace CF_026A {
    class Program {
        static void Main(string[] args) {
            //gen p
            int[] p=new int[1000]; p[0]=2;
            int u=1,t=3,j; while(t<3000) { p[u]=t; j=1; while(t%p[j]!=0) j++; if(j==u) u++; t+=2; }
            int o=0,n=int.Parse(Console.ReadLine()),i=1;

            for(i=6;i<=n;i++) {
                t=i;
                j=0; while(t%p[j]!=0) j++;
                if(t==p[j]) continue;
                while(t%p[j]==0) t/=p[j];
                if(t==1) continue;
                while(t%p[j]!=0) j++;
                while(t%p[j]==0) t/=p[j];
                if(t==1) o++;
            }
            Console.WriteLine(o);
        }
    }
}

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

class CF_26A
{
    static int[] getPrime(int n)
    {
        bool[] isPrime = Enumerable.Repeat(true, n + 1).ToArray();
        isPrime[0] = false;
        isPrime[1] = false;
        List<int> prime = new List<int>();
        for (int i = 2; i < n + 1; i++)
        {
            if (isPrime[i])
            {
                prime.Add(i);
                for (int j = i + i; j < n + 1; j += i)
                {
                    isPrime[j] = false;
                }
            }
        }
        return prime.ToArray();
    }

    static void Main()
    {
        int n = int.Parse(Console.ReadLine());
        int[] prime = getPrime(n);
        int[] cnt = Enumerable.Repeat(0, n + 1).ToArray();
        for (int i = 2; i <= n; i++)
        {
            foreach (int p in prime)
            {
                if (i % p == 0)
                {
                    cnt[i]++;
                }
                if (i < p || cnt[i] > 2)
                {
                    break;
                }
            }
        }
        Console.WriteLine(cnt.Count(x => x == 2));
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp4
{
    class Program
    {
        public static bool Prost(ushort x)
        {
            bool p = true;
            for (ushort z = 2; z <= x / 2; z++)
                if (x % z == 0)
                    p = false;
            return p;
        }
        static void Main(string[] args)
        {
            ushort n = ushort.Parse(Console.ReadLine());
            ushort b = 0;
            for(ushort i =6;i<=n;i++)
            {
                ushort x = i;
                for(ushort j =2; j<=x;j++)
                {
                    if ((Prost(j)) && (x % j == 0))
                    {
                        while (x % j == 0)
                            x = (ushort)(x / j);
                        break;
                    }
                }
                if (x != 1)
                {
                    for (ushort k = 3; k <= x; k++)
                    {
                        if ((Prost(k)) && (x % k == 0))
                        {
                            while (x % k == 0)
                                x = (ushort)(x / k);
                            break;
                        }
                    }
                    if (x == 1)
                    {
                        b++;
                    }
                }

            }
            Console.WriteLine(b);
        }
    }
}

using System;

public class Test
{
	public static void Main()
	{
		int n =Convert.ToInt32(Console.ReadLine());
		int prost=0;
		for(int i=1;i<n+1;i++)
		{
			int kolvo=0;
			for(int j=2; j<=i/2;j++)
			{
				if (i%j==0)
				{
					int ololo=0;
					for(int k=2;k<=j/2;k++) if(j%k==0) ololo++;
					if (ololo==0) kolvo++;
				}

			}
			if (kolvo==2)  prost++;
		}
		Console.WriteLine(prost);
	}
}

using System;

namespace Task26A
{
    class Program
    {
        static void Main(string[] args)
        {
            int n, ans = 0;
            n = Convert.ToInt32(Console.ReadLine());
            for (int i = 0; i <= n; i++)
                if (isAlmastPrime(i))
                    ans++;
            if (ans > 0)
                Console.WriteLine(ans);
            else Console.WriteLine(0);
        }
         private static bool isPrime(int N)
        {
            if (N == 2) return true;
            if (N < 2 || N % 2 == 0) return false;
            for (int i = 3; i <= N/2; i += 2)
                if (N % i == 0) return false;
            return true;
        }
          private static bool isAlmastPrime(int N)
        {
            int count = 0;
            for (int i = 2; i <= N; i++)
                if (N % i == 0 && isPrime(i))
                    count++;

            return count == 2;
        }

    }
}

using System;
using System.Collections.Generic;
using System.Linq;
namespace Task26A
{
    class Program
    {
        static void Main(string[] args)
        {
            int n, ans = 0;
            n = Convert.ToInt32(Console.ReadLine());
            List <int>  primes=new List <int> ();
            for(int i = 2; i <= n; i++)
                if (isPrime(i))
                    primes.Add(i);

            for (int i = 1; i <= n; i++)
                if (isAlmastPrime(ref primes,i))
                    ans++;

            Console.WriteLine(ans);
        }

         private static bool isPrime(int N)
        {
            if (N == 2) return true;
            if (N < 2 || N % 2 == 0) return false;
            for (int i = 3; i <=Math.Sqrt(N); i += 2)
                if (N % i == 0) return false;
            return true;
        }

          private static bool isAlmastPrime(ref List<int> mylist, int item)
        {
            int count = 0;
            for (int i = 0; i <mylist.Count; i++) {

                if (item%mylist[i]== 0)
                    count++;
                if (count > 2)
                    return false;
              }
            return count == 2;
        }

    }
}

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

namespace Euler187
{
    class Program
    {
        static bool Prime(int n)
        {
            double x = Math.Sqrt(n);
            for (int i = 2; i <= x; i++)
                if (n % i == 0)
                    return false;
            return true;
        }
        static bool Div(int n)
        {
            int alphacount = 0;
            for (int i = 2; i <=n; i++)
            {
                if (n % i == 0)
                    alphacount++;
                while (n % i == 0)
                {
                    n /= i;
                }

            }
            return alphacount==2;
        }
        static void Main(string[] args)
        {
            string s=Console.ReadLine();
            int n = Convert.ToInt32(s);
            int count = 0;
            for (int i = 2; i <= n; i++)
            {
                if (Div(i))
                    count++;
                //Console.WriteLine(i);
            }
            Console.WriteLine(count);
        }
    }
}

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

namespace ConsoleApplication5
{
    class Program
    {

        static bool[] Socrat(int a)
        {
            bool[] m = new bool[a];
            for (int i = 2; i < a; i++)
            {
                if (m[i] == false)
                {
                    for (int j = 1; i + i * j < a; j++)
                    {
                        m[i + i * j] = true;
                    }
                }
            }
            return m;
        }

        static void Main()
        {
            int n = int.Parse(Console.ReadLine());
            bool[] k = new bool[n+1];
            k = Socrat(n+1);
            int count = 0;

            for (int i = 6; i <= n; i++)
            {
                int g=0;
                for (int j = 2; j <= n; j++)
                {
                    if (k[j] == false)
                    {
                        if (i % j == 0)
                            g++;
                    }
                    if (g > 2)
                        break;
                }
                if (g == 2)
                    count++;

            }

            Console.WriteLine(count);
        }
    }
}

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

namespace ConsoleApplication5
{
    class Program
    {

        static void Main()
        {

            //находим простые числа тупым методом перебора
            int n = int.Parse(Console.ReadLine());
            bool[] prost = new bool[n+1];
            bool k = false;

            for (int i = 2; i <= n; i++)
            {
                for (int j = 2; j < i; j++)
                {
                    if (i % j == 0)
                    {
                        k = true;
                        break;
                    }
                }
                if (k == false)
                {
                    prost[i] = true;
                }
                k = false;
            }

            //тупо проверяем все числа от 6 до Н на делимость на ранее найденные простые числа

            int count = 0;
            int countotvet = 0;
            for (int i = 6; i <= n; i++)
            {
                count = 0;
                for (int j = 2; j <= i; j++)
                {
                    if (i % j == 0 && prost[j] != false)
                        count++;
                    if (count > 2)
                    {
                        count = 0;
                        break;
                    }
                }
                if (count == 2)
                    countotvet++;

            }

            Console.WriteLine(countotvet);

        }
    }
}

using System;
using System.Collections.Generic;

namespace AlmostPrime26A
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = Convert.ToInt32(Console.ReadLine());
            Console.WriteLine(almostPrimeNumbers(n));

        }
        static int almostPrimeNumbers(int N)
        {
            int count = 0, primeCounter = 0;
            List<int> primeList = new List<int>();
            primeList.Add(2);
            for (int i = 3; i < N; i+=2)
            {

                if (Program.IsPrime(i))
                {
                    primeList.Add(i);
                }

            }
            for(int j=1;j<=N;j++)
            {
                for(int i=0;i<primeList.Count;i++)
                {
                    if (j % primeList[i] == 0 )
                    {
                        count++;
                    }
                }
                if (count == 2)
                {
                    primeCounter++;
                    count = 0;
                }
                else count = 0;
            }
            return primeCounter;

        }
        private static bool IsPrime(int N)
        {

            if (N == 2) return true;
            if (N % 2 == 0 || N < 2) return false;

            for (int i = 3; i <= Math.Sqrt(N); i += 2)
                if (N % i == 0) return false;

            return true;

        }
    }
}

/***************************************************************************
* Title : Almost Prime
* URL   : http://codeforces.com/problemset/problem/26/A
* Contst: Offline
* Date  : 2018-04-27
* Author: Atiq Rahman
* Comp  : O(N)
* Status: Accepted
* Notes : This is not really a good problem for practicing implementation of
*   doubly linked list. Building LinkedList is not trivial since nodes are out
*   of order.. we can say this place for practicing alternative doubly linked
*   list representation.

* meta  : tag-linked-list, tag-easy
***************************************************************************/
using System;
using System.Collections.Generic;

public class PrimeUtil {
  // The access level for class members and struct members, including nested
  // classes and structs, is private by default.
  // ref: https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/
  // classes-and-structs/access-modifiers
  List<int> primes;
  int n;

  // Divide each candidate number (starting from 6) by prime numbers to find
  // divisors. Keep dividing the number with the divisor/factor. Do it twice
  // and if the number comes down to one after those divisions we got an
  // almost prime
  public int FindAlmostPrimes()
  {
    int count = 0;

    for (int num = 6; num <= n; num++) {
      int firstPrimeDivisorIndex = GetPrimeFactor(num);
      if (firstPrimeDivisorIndex == -1)
        continue;
      // divide the number as long as it is divisible by factor
      int dNum = DivideDown(num, primes[firstPrimeDivisorIndex]);
      int secondPrimeDivisorIndex = GetPrimeFactor(dNum, firstPrimeDivisorIndex
        + 1);
      if (secondPrimeDivisorIndex == -1)
        continue;
      if (DivideDown(dNum, primes[secondPrimeDivisorIndex]) == 1)
        count++;
    }
    return count;
  }

  private int GetPrimeFactor(int num, int startIndex=0) {
    if (num < 2)
      return -1;
    // find prime divisotr/factor
    for (int i= startIndex; primes[i] <= num && i<primes.Count; i++)
      if (num % primes[i] == 0)
        return i;
    return -1;
  }

  private int DivideDown(int num, int factor) {
    while (num % factor == 0)
      num /= factor;
    return num;
  }

  // Dynamic Programming for generating primes
  // O(N*C)
  public void GeneratePrimes() {
    primes = new List<int>(new int[] { 2 });
    for (int j = 3; j <= n; j += 2) {
      int pi = 1;
      for (; pi < primes.Count; pi++)
        if (j % primes[pi] == 0)
          break;
      if (pi == primes.Count)
        primes.Add(j);
    }
  }

  public void Input()
  {
    n = int.Parse(Console.ReadLine());
  }
}

public class CF_Solution {
  public static void Main() {
    PrimeUtil primeDemo = new PrimeUtil();
    primeDemo.Input();
    primeDemo.GeneratePrimes();
    Console.WriteLine(primeDemo.FindAlmostPrimes());
  }
}

// done
/***************************************************************************
* Title : Almost Prime
* URL   : http://codeforces.com/problemset/problem/26/A
* Contst: Offline
* Date  : 2018-04-27
* Author: Atiq Rahman
* Comp  : O(N)
* Status: Accepted
* Notes : This is not really a good problem for practicing implementation of
*   doubly linked list. Building LinkedList is not trivial since nodes are out
*   of order.. we can say this place for practicing alternative doubly linked
*   list representation.
*
*   Applications of this problem:
*   Test Prime Number Generatation algorithm up to a small range (<=3000)
*
*   With this problem following Prime Generation Algos tested,
*   - Dynamic Programming Approach for generating primes
*   - Sieve of Eratosthenes
*
*   related: 'uva-online-judge/old/10699_Count the factors.cpp'
* meta  : tag-linked-list, tag-easy
***************************************************************************/
using System;
using System.Collections.Generic;

public class PrimeUtil {
  // The access level for class members and struct members, including nested
  // classes and structs, is private by default.
  // ref: https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/
  // classes-and-structs/access-modifiers
  List<int> primes;
  System.Collections.BitArray isPrime;
  int n;

  // Divide each candidate number (starting from 6) by prime numbers to find
  // divisors. Keep dividing the number with the divisor/factor. Do it twice
  // and if the number comes down to one after those divisions we got an
  // almost prime
  public int FindAlmostPrimes()
  {
    int count = 0;

    for (int num = 6; num <= n; num++) {
      int firstPrimeDivisorIndex = GetPrimeFactor(num);
      if (firstPrimeDivisorIndex == -1)
        continue;
      // divide the number as long as it is divisible by factor
      int dNum = DivideDown(num, primes[firstPrimeDivisorIndex]);
      int secondPrimeDivisorIndex = GetPrimeFactor(dNum, firstPrimeDivisorIndex
        + 1);
      if (secondPrimeDivisorIndex == -1)
        continue;
      if (DivideDown(dNum, primes[secondPrimeDivisorIndex]) == 1)
        count++;
    }
    return count;
  }

  // start from the index after the previous prime factor's index
  private int GetPrimeFactor(int num, int startIndex=0) {
    if (num == 1)
      return -1;
    // find prime divisor/factor
    for (int i= startIndex; primes[i] <= num && i<primes.Count; i++)
      if (num % primes[i] == 0)
        return i;
    return -1;
  }

  private int DivideDown(int num, int factor) {
    while (num % factor == 0)
      num /= factor;
    return num;
  }

  // Dynamic Programming for generating primes
  // O(N*C)
  /* public void GeneratePrimes()
  {
    primes = new List<int>(new int[] { 2 });
    for (int j = 3; j <= n; j += 2) {
      int pi = 1;   // index inside the prime number collection
      for (; pi < primes.Count; pi++)
        if (j % primes[pi] == 0)
          break;
      if (pi == primes.Count)
        primes.Add(j);
    }
  }*/

  /*
   consider example,
   2, 3, 4,
  */
  // Sieve
  public void GeneratePrimes()
  {
    isPrime = new System.Collections.BitArray(n + 1, true);
    for (int i = 3; i * i <= n; i+=2)
      if (isPrime.Get(i))
        for (int j = i * i; j <= n; j += i)
          isPrime.Set(j, false);

    primes = new List<int>(new int[] { 2 });
    for (int i = 3; i <= n; i+=2)
      if (isPrime.Get(i))
        primes.Add(i);
  }

  public void Input()
  {
    n = int.Parse(Console.ReadLine());
  }
}

public class CF_Solution {
  public static void Main() {
    PrimeUtil primeDemo = new PrimeUtil();
    primeDemo.Input();
    primeDemo.GeneratePrimes();
    Console.WriteLine(primeDemo.FindAlmostPrimes());
  }
}

// done
/***************************************************************************
* Title : Almost Prime
* URL   : http://codeforces.com/problemset/problem/26/A
* Contst: Offline
* Date  : 2018-04-27
* Author: Atiq Rahman
* Comp  : O(N)
* Status: Accepted
* Notes : This is not really a good problem for practicing implementation of
*   doubly linked list. Building LinkedList is not trivial since nodes are out
*   of order.. we can say this place for practicing alternative doubly linked
*   list representation.
*
*   Applications of this problem:
*   Test Prime Number Generatation algorithms
* meta  : tag-linked-list, tag-easy
***************************************************************************/
using System;
using System.Collections.Generic;

public class PrimeUtil {
  // The access level for class members and struct members, including nested
  // classes and structs, is private by default.
  // ref: https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/
  // classes-and-structs/access-modifiers
  List<int> primes;
  int n;

  // Divide each candidate number (starting from 6) by prime numbers to find
  // divisors. Keep dividing the number with the divisor/factor. Do it twice
  // and if the number comes down to one after those divisions we got an
  // almost prime
  public int FindAlmostPrimes()
  {
    int count = 0;

    for (int num = 6; num <= n; num++) {
      int firstPrimeDivisorIndex = GetPrimeFactor(num);
      if (firstPrimeDivisorIndex == -1)
        continue;
      // divide the number as long as it is divisible by factor
      int dNum = DivideDown(num, primes[firstPrimeDivisorIndex]);
      int secondPrimeDivisorIndex = GetPrimeFactor(dNum, firstPrimeDivisorIndex
        + 1);
      if (secondPrimeDivisorIndex == -1)
        continue;
      if (DivideDown(dNum, primes[secondPrimeDivisorIndex]) == 1)
        count++;
    }
    return count;
  }

  // start from the index after the previous prime factor's index
  private int GetPrimeFactor(int num, int startIndex=0) {
    if (num == 1)
      return -1;
    // find prime divisotr/factor
    for (int i= startIndex; primes[i] <= num && i<primes.Count; i++)
      if (num % primes[i] == 0)
        return i;
    return -1;
  }

  private int DivideDown(int num, int factor) {
    while (num % factor == 0)
      num /= factor;
    return num;
  }

  // Dynamic Programming for generating primes
  // O(N*C)
  public void GeneratePrimes() {
    primes = new List<int>(new int[] { 2 });
    for (int j = 3; j <= n; j += 2) {
      int pi = 1;   // index inside the prime number collection
      for (; pi < primes.Count; pi++)
        if (j % primes[pi] == 0)
          break;
      if (pi == primes.Count)
        primes.Add(j);
    }
  }

  public void Input()
  {
    n = int.Parse(Console.ReadLine());
  }
}

public class CF_Solution {
  public static void Main() {
    PrimeUtil primeDemo = new PrimeUtil();
    primeDemo.Input();
    primeDemo.GeneratePrimes();
    Console.WriteLine(primeDemo.FindAlmostPrimes());
  }
}

using System;

public class ProblemA
{
        public static void Main(String[] args)
        {
                int n = 0;

                Int32.TryParse(Console.ReadLine(), out n);

                int solution = 0;

                for (int i=6; i <= n; i++)
                {
                        int temp = i;
                        int primeDivisorCount = 0;
                        if (temp % 2 == 0)
                        {
                                primeDivisorCount++;
                                while (temp % 2 == 0)
                                {
                                        temp = temp / 2;
                                }
                        }

                        int oddDivisor = 3;
                        while (temp >= oddDivisor)
                        {
                                if (temp % oddDivisor == 0)
                                {
                                        primeDivisorCount++;
                                        if (primeDivisorCount > 2)
                                        {
                                                break;
                                        }
                                        while (temp % oddDivisor == 0)
                                        {
                                                temp = temp / oddDivisor;
                                        }
                                }
                                oddDivisor += 2;
                        }

                        if (primeDivisorCount == 2)
                        {
                                solution++;
                        }
                }
                Console.WriteLine(solution);
        }
}

// 6 min

using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Threading;
using System.Diagnostics;
using System.Globalization;
using System.Text.RegularExpressions;

namespace sar_cs
{
    class Program
    {
        class Parser
        {
            const int BufSize = 25000;
            TextReader s;
            char[] buf = new char[BufSize];
            int bufPos;
            int bufDataSize;
            bool eos;   // eos read to buffer
            int lastChar = -2;
            int nextChar = -2;
            StringBuilder sb = new StringBuilder();

            void FillBuf()
            {
                if (eos) return;
                bufDataSize = s.Read(buf, 0, BufSize);
                if (bufDataSize == 0) eos = true;
                bufPos = 0;
            }

            int Read()
            {
                if (nextChar != -2)
                {
                    lastChar = nextChar;
                    nextChar = -2;
                }
                else
                {
                    if (bufPos == bufDataSize) FillBuf();
                    if (eos) lastChar = -1;
                    else lastChar = buf[bufPos++];
                }
                return lastChar;
            }

            void Back()
            {
                if (lastChar == -2) throw new Exception();  // no chars were ever read
                nextChar = lastChar;
            }

            public Parser()
            {
                s = Console.In;
            }

            public int ReadInt()
            {
                int res = 0;
                int sign = -1;
                int c;
                do { c = Read(); } while (c >= 0 && char.IsWhiteSpace((char)c));
                if (c == '-')
                {
                    sign = -sign;
                    c = Read();
                }
                int len = 0;
                while (c >= 0 && !char.IsWhiteSpace((char)c))
                {
                    if ((uint)(c -= 48) >= 10) throw new InvalidDataException();
                    len++;
                    res = checked(res * 10 - c);
                    c = Read();
                }
                if (len == 0) throw new InvalidDataException();
                Back();
                return checked(res * sign);
            }

            public long ReadLong()
            {
                long res = 0;
                int sign = -1;
                int c;
                do { c = Read(); } while (c >= 0 && char.IsWhiteSpace((char)c));
                if (c == '-')
                {
                    sign = -sign;
                    c = Read();
                }
                int len = 0;
                checked
                {
                    while (c >= 0 && !char.IsWhiteSpace((char)c))
                    {
                        if ((uint)(c -= 48) >= 10) throw new InvalidDataException();
                        len++;
                        res = res * 10 - c;
                        c = Read();
                    }
                    if (len == 0) throw new InvalidDataException();
                    Back();
                    return res * sign;
                }
            }

            public double ReadDouble()
            {
                int c;
                do { c = Read(); } while (c >= 0 && char.IsWhiteSpace((char)c));

                int sign = 1;
                if (c == '-')
                {
                    sign = -1;
                    c = Read();
                }

                sb.Length = 0;
                while (c >= 0 && !char.IsWhiteSpace((char)c))
                {
                    sb.Append((char)c);
                    c = Read();
                }

                Back();
                double res = double.Parse(sb.ToString(), CultureInfo.InvariantCulture);
                return res * sign;
            }

            public string ReadLine()
            {
                int c = Read();
                sb.Length = 0;
                while (c != -1 && c != 13 && c != 10)
                {
                    sb.Append((char)c);
                    c = Read();
                }
                if (c == 13)
                {
                    c = Read();
                    if (c != 10) Back();
                }
                return sb.ToString();
            }

            public bool EOF
            {
                get
                {
                    if (Read() == -1) return true;
                    Back();
                    return false;
                }
            }

            public bool SeekEOF
            {
                get
                {
                L0:
                    int c = Read();
                    if (c == -1) return true;
                    if (char.IsWhiteSpace((char)c)) goto L0;
                    Back();
                    return false;
                }
            }
        }

        static void pe()
        {
            Console.WriteLine("???");
            Environment.Exit(0);
        }

        static void re()
        {
            Environment.Exit(55);
        }

        static int nosol()
        {
            Console.WriteLine("ERROR");
            return 0;
        }

        static Stopwatch sw = Stopwatch.StartNew();

        static void Test()
        {
            Random rand = new Random(52345235);
            for (int i = 0; i < 2e6; i++)
            {
            }
        }

        class Numbers
        {
            static Random rnd = new Random();

            public static void Test()
            {
                int cnt = 0;
                for (int i = 1; i <= 1000000; i++)
                    if (IsPrime(i * 1L, 10))
                        cnt++;
                if (cnt != 78498) throw new Exception();

                if (GetPrimes(1000000).Count != 78498) throw new Exception();

                while (true)
                {
                    long t = (long)(rnd.NextDouble() * 1e3 + 1);
                    List<KeyValuePair<long, int>> fact = Factorization(t);
                    long res = 1;
                    KeyValuePair<long, int> last_kvp = new KeyValuePair<long, int>(1, 0);
                    foreach (KeyValuePair<long, int> kvp in fact)
                    {
                        if (kvp.Key <= last_kvp.Key) throw new Exception();
                        if (!IsPrime(kvp.Key, 30)) throw new Exception();
                        res *= (long)Math.Pow(kvp.Key, kvp.Value);
                        last_kvp = kvp;
                    }
                    if (res != t) throw new Exception();
                }

                //for (int i = 2; i < 100; i += 10)
                //{
                //    List<int> p = GetPrimes(i);
                //    int est = (int)(1.2 * (i) / Math.Log(i));
                //    Console.WriteLine(p.Count + " " + ((double)est / p.Count));
                //}

                return;
            }

            public static List<int> GetPrimes(int n)
            {
                if (n < 0) throw new ArgumentException();
                if (n < 2) return new List<int>(0);
                bool[] a = new bool[n - 1];
                int x = 2;
                while (x * x <= n)
                {
                    for (int i = x + x; i <= n; i += x) a[i - 2] = true;
                    do { x++; } while (x <= n && a[x - 2]);
                }

                int est = (int)(1.2 * (n) / Math.Log(n));
                List<int> res = new List<int>(est);
                for (int i = 2; i <= n; i++)
                    if (!a[i - 2]) res.Add(i);
                return res;
            }

            public static bool IsPrime(int n, int s)
            {
                if (n <= 0) throw new Exception();
                if (n == 1) return false;
                if (n == 2) return true;

                int b = n - 1;
                int b_highbit = 1 << 30;
                while ((b & b_highbit) == 0) b_highbit >>= 1;

                for (; s > 0; s--)
                {
                    int a = rnd.Next(2, n);
                    int c = 1;
                    for (int bit = b_highbit; bit != 0; bit >>= 1)
                    {
                        int x = c;
                        c = (int)((long)c * c % n);
                        if (c == 1 && x != 1 && x != n - 1) return false;
                        if ((b & bit) != 0) c = (int)((long)c * a % n);
                    }
                    if (c != 1) return false;
                }
                return true;
            }

            public static bool IsPrime(long n, int s)
            {
                if (n <= 0) throw new Exception();
                if (n == 1) return false;
                if (n == 2) return true;

                long b = n - 1;
                long b_highbit = 1L << 62;
                while ((b & b_highbit) == 0) b_highbit >>= 1;

                checked
                {
                    for (; s > 0; s--)
                    {
                        long a = (long)(rnd.NextDouble() * (n - 1 - 2 + 1)) + 2;
                        long c = 1;
                        for (long bit = b_highbit; bit != 0; bit >>= 1)
                        {
                            long x = c;
                            c = (long)((decimal)c * c % n);
                            if (c == 1 && x != 1 && x != n - 1) return false;
                            if ((b & bit) != 0) c = (long)((decimal)c * a % n);
                        }
                        if (c != 1) return false;
                    }
                    return true;
                }
            }

            static List<int> primes_cache;
            static int primes_cache_n = -1;

            public static List<KeyValuePair<int, int>> Factorization(int n)
            {
                if (n <= 0) throw new ArgumentException();
                List<KeyValuePair<int, int>> res = new List<KeyValuePair<int, int>>();

                int sqrt_n = (int)(Math.Sqrt(n));

                if (primes_cache_n < sqrt_n)
                {
                    primes_cache = GetPrimes(sqrt_n);
                    primes_cache_n = sqrt_n;
                }

                int p = 0;
                while (n > 1)
                {
                    if (p >= primes_cache.Count || primes_cache[p] > sqrt_n) break;
                    if (n % primes_cache[p] == 0)
                    {
                        int q = 0;
                        do
                        {
                            n /= primes_cache[p];
                            q++;
                        } while (n % primes_cache[p] == 0);
                        res.Add(new KeyValuePair<int, int>(primes_cache[p], q));
                    }
                    p++;
                }

                if (n > 1) res.Add(new KeyValuePair<int, int>(n, 1));

                return res;
            }

            public static List<KeyValuePair<long, int>> Factorization(long n)
            {
                if (n <= 0) throw new ArgumentException();
                List<KeyValuePair<long, int>> res = new List<KeyValuePair<long, int>>();

                int sqrt_n = checked((int)(Math.Sqrt(n)));

                if (primes_cache_n < sqrt_n)
                {
                    primes_cache = GetPrimes(sqrt_n);
                    primes_cache_n = sqrt_n;
                }

                int p = 0;
                while (n > 1)
                {
                    if (p >= primes_cache.Count || primes_cache[p] > sqrt_n) break;
                    if (n % primes_cache[p] == 0)
                    {
                        int q = 0;
                        do
                        {
                            n /= primes_cache[p];
                            q++;
                        } while (n % primes_cache[p] == 0);
                        res.Add(new KeyValuePair<long, int>(primes_cache[p], q));
                    }
                    p++;
                }

                if (n > 1) res.Add(new KeyValuePair<long, int>(n, 1));

                return res;
            }
        }

        static int Main(string[] args)
        {
            //Test(); return 0;
            //Console.SetIn(File.OpenText("_input"));
            //Console.SetOut(File.CreateText("_out"));
            Parser parser = new Parser();

            while (!parser.SeekEOF)
            {
                int n=parser.ReadInt();
                int q = 0;
                for (int i = 1; i <= n; i++)
                {
                    List<KeyValuePair<int, int>> f = Numbers.Factorization(i);
                    if (f.Count == 2) q++;
                }

                Console.WriteLine(q);
            }
            sw.Stop();
            return 0;
        }
    }
}

using System;
using System.Text;

namespace contest26
{
    class Program
    {
        static int Main(string[] args)
        {
            string s = Console.ReadLine();
            int n = int.Parse(s);
            int cnt = 0;
            for (int i = 4; i <= n; ++i)
            {
                int N = i;
                int divCnt = 0;
                for (int j = 2; j * j <= N; ++j)
                {
                    if (N % j == 0)
                        divCnt++;
                    while (N % j == 0)
                        N /= j;
                }
                if (N > 1)
                    divCnt++;

                if (divCnt == 2)
                    cnt++;
            }

            Console.WriteLine(cnt);
            return 0;
        }
    }
}

using System;

namespace Task_26A
{
    class Program
    {
       static bool IsPrime(int num)
        {
            if (num == 2)
                return true;
            if (num < 0 || num % 2 == 0)
                return false;
            int limit = (int)Math.Sqrt(num);
            for (int i = 3; i <= limit; i += 2)
            {
                if (num % i == 0)
                    return false;
            }
            return true;
        }
        static void Main(string[] args)
        {
            int num = Convert.ToInt32(Console.ReadLine());
            int counter = 0, ans = 0;

            for(int i = 2; i<= num; i++)
            {
                for(int j = 2; j<=num; j++)
                {
                    if (i % j == 0 && IsPrime(j))
                        counter++;
                }
                if (counter == 2)
                {
                    ans++;
                    counter = 0;
                }
                else
                    counter = 0;
            }
            Console.WriteLine(ans);
        }
    }
}

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

namespace Task26A
{
    class Program
    {
        static void Main(string[] args)
        {
            int N = int.Parse(Console.ReadLine());
            List<int> Primes = new List<int>();
            for (int i = 2; i <= N; i++)
                if (IsPrime(i)) Primes.Add(i);

            int ans = 0;
            for (int i = 1; i <= N; i++)
                if (IsAlmostPrime(i, ref Primes)) ans++;

            Console.WriteLine(ans);

        }
        private static bool IsAlmostPrime(int n, ref List<int> pNums)
        { int countDivisor = 0;
            for (int i = 0; i < pNums.Count; i++)
            {
                if (n % pNums[i] == 0) countDivisor++;
                if (pNums[i] > n / 2) break;
            }
            return countDivisor == 2;
        }
        private static bool IsPrime(int n)
        {

            if (n == 2 ) return true;
            if (n <= 1|| n%2==0)
                return false;

            //for (int i = 2; i <= n/2; i++)
            //    if (n % i == 0)
            //        return false;

            for (int i = 3; i <= Math.Sqrt(n); i+=2)
                if (n % i == 0)
                    return false;

            return true;
        }

    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            var n = int.Parse(Console.ReadLine());
            var isNotPrime = new bool[n+1];
            isNotPrime[0] = true;
            isNotPrime[1] = true;
            var primes = new List<int>();
            for (int i = 2; i <= n; i++)
            {
                if(isNotPrime[i])
                    continue;
                primes.Add(i);
                for (int j = i*i; j <= n; j+=i)
                    isNotPrime[j] = true;
            }

            var res = 0;
            for (int i = 6; i <= n; i++)
            {
                var cnt = 0;
                for (int j = 0; j < primes.Count; j++)
                {
                    if (i%primes[j] == 0)
                        cnt++;
                    if(cnt > 2)
                        break;
                }

                if (cnt == 2)
                    res++;
            }

            Console.WriteLine(res);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            var n = int.Parse(Console.ReadLine());
            var cntPrimes = n/2 + 2;
            var isNotPrime = new bool[cntPrimes];
            isNotPrime[0] = true;
            isNotPrime[1] = true;
            var primes = new List<int>();
            for (int i = 2; i < cntPrimes; i++)
            {
                if(isNotPrime[i])
                    continue;
                primes.Add(i);
                for (int j = i * i; j < cntPrimes; j += i)
                    isNotPrime[j] = true;
            }

            var res = 0;
            for (int i = 6; i <= n; i++)
            {
                var cnt = 0;
                for (int j = 0; j < primes.Count; j++)
                {
                    if (i%primes[j] == 0)
                        cnt++;
                    if(cnt > 2)
                        break;
                }

                if (cnt == 2)
                    res++;
            }

            Console.WriteLine(res);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Text;

namespace _26A
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] mas = new int[1000];
            int[] p = new int[3001];
            mas[0] = 2;
            mas[1] = 3;
            mas[2] = 5;
            mas[3] = 7;
            int k = 4;
            for (int i = 10; i < 3000; i++)
            {
                if (isProst(i, k, mas))
                {
                    mas[k] = i;
                    k++;
                }
            }
            int count = 0;
            for (int i = 1; i <= 3000; i++)
            {
                if (isPProst(i, k, mas))
                {
                    count++;
                }
                p[i] = count;
            }
            int n = int.Parse(Console.ReadLine());
            Console.WriteLine(p[n]);
            Console.ReadLine();
        }

        static bool isProst(int ch, int k, int[] mas)
        {
            bool f = true;
            for (int i = 0; i < k; i++)
            {
                if (ch % mas[i] == 0)
                {
                    f = false;
                    break;
                }
            }
            return f;
        }
        static bool isPProst(int ch, int k, int[] mas)
        {
            int count = 0;
            for (int i = 0; i < k; i++)
            {
                if (ch % mas[i] == 0)
                {
                    count++;
                }
            }

            return count == 2;
        }
    }
}

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

namespace ConsoleApplicationNick1
{
    class Program
    {
        static void Main()
        {
            int n, m, i, j, col;
            string s;
            int plen;
            int[] p;
            bool flag;
            p = new int[3000];
            Int32.TryParse(Console.ReadLine(), out n);
            plen=1;
            p[0]=2;
            for (i = 3; i <= n; i++)
            {
                flag = true;
                for (j = 0; flag && j < plen; j++)
                {
                    if (i % p[j] == 0) { flag = false; }
                }
                if (flag) {
                    p[plen] = i;
                    plen++;
                    //Console.Write(i+"\n");
                }
            }
            m = 0;
            for (i = 1; i <= n; i++)
            {
                col = 0;
                for (j = 0; j< plen && p[j] < i; j++)
                {
                    if (i % p[j] == 0) { col++; }
                }
                if (col == 2) { m++; }
            }
            Console.Write(m);
        }
    }
}

using System;

public class Program
{
	public static void Main()
	{
		int num = int.Parse(Console.ReadLine());

		if(num < 6)
		{
			Console.WriteLine(0);
			return;
		}

		int count = 0;

		for(int i = 6; i <= num; i++)
		{
			int countPrime = 0;

			for(int j = 2; j <= i / 2; j++)
			{
				if(i % j == 0 && IsPrime(j))
				{
					countPrime++;

					if(countPrime > 2)
					{
						break;
					}
				}
			}

			if(countPrime == 2)
			{
				count++;
			}
		}

		Console.WriteLine(count);
	}

	public static bool IsPrime(int num)
	{
		if(num == 2 || num == 3)
		{
			return true;
		}

		if(num % 2 == 0)
		{
			return false;
		}

		for(int i = 3; i <= num / 3; i += 2)
		{
			if(num % i == 0)
			{
				return false;
			}
		}

		return true;
	}
}

using System;
using System.Collections.Generic;

namespace _26_1
{
    class Program
    {
        static void Main(string[] args)
        {
            List<int> pr = new List<int>();
            pr.Add(2);
            int temp = 3;
            bool good;
            while (temp < 3000)
            {
                good = true;
                for (int i = 0; pr[i] * pr[i] <= temp; i++ )
                {
                    if (temp % pr[i] == 0)
                    {
                        good = false;
                        break;
                    }
                }
                if (good) pr.Add(temp);
                temp += 2;
            }
            int res = 0;
            int n = int.Parse(Console.ReadLine());
            int cur,cnt, index;
            for (int i = 2; i<= n; i++)
            {
                cur = i;
                cnt = 0;
                index = 0;
                while (cur>1)
                {
                    if (cur%pr[index]==0)
                    {
                        cnt++;
                        while (cur%pr[index]==0)
                            cur/=pr[index];
                    }
                    index++;
                }
                if (cnt==2)
                    res++;
            }
            Console.WriteLine(res);
        }
    }
}

using System;

class P {
  static void Main() {
    var n = int.Parse(Console.ReadLine());
    var nDiv = new int[n+1];
    for (var i = 2 ; i <= n ; i++) if (nDiv[i] == 0)
      for (var j = i; j <= n; j+=i) nDiv[j]++;
    var count = 0;
    for (var i = 2; i <= n; i++) if (nDiv[i] == 2) count++;
    Console.Write(count);
  }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication8
{
    class Program
    {
        static void Main(string[] args)
        {
            const int max_number=3000;
            bool[] isPrime = new bool[max_number+1];
            int n = int.Parse(Console.ReadLine());
            for (int i = 2; i <= n; i++) isPrime[i] = true;
            int max_factor=(int)Math.Sqrt(n);
            for (int i = 2; i <= max_factor; i++)
                if (isPrime[i])
                    for (int j = i * i; j <= n; j += i) isPrime[j] = false;

            int count = 0;
            for (int j = 2; j <= n; j++)
            {
                max_factor = (int)Math.Sqrt(j);
                int prime_divisors = 0;
                for (int i = 2; i <= max_factor; i++)
                {
                    if (j%i==0 && i!=j/i)
                    {
                        if (isPrime[i]) prime_divisors++;
                        if (isPrime[j / i]) prime_divisors++;
                        if (prime_divisors == 3) break;
                    }
                }
                if (prime_divisors == 2) count++;
            }
              Console.WriteLine(count);
         }
    }
}

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;

namespace Almost_Prime
{
    internal class Program
    {
        private static readonly StreamReader reader = new StreamReader(Console.OpenStandardInput(1024*10), Encoding.ASCII, false, 1024*10);
        private static readonly StreamWriter writer = new StreamWriter(Console.OpenStandardOutput(1024*10), Encoding.ASCII, 1024*10);

        private static void Main(string[] args)
        {
            int n = Next();

            var pr = new List<int> {2, 3};
            for (int i = 5; i < n; i += 2)
            {
                if (pr.All(j => i%j != 0))
                    pr.Add(i);
            }
            var che = new List<int>();
            for (int i = 1; i < pr.Count; i++)
            {
                int d = pr[i];
                while (d <= n)
                {
                    che.Add(d);
                    d *= pr[i];
                }
            }
            che.Sort();

            int count = 0;
            for (int i = 6; i <= n; i++)
            {
                for (int j = 0; j < pr.Count; j++)
                {
                    if (i <= pr[j])
                        break;

                    if (i%pr[j] == 0)
                    {
                        int o = i;
                        while (o%pr[j] == 0)
                        {
                            o /= pr[j];
                        }
                        int index = che.BinarySearch(o);
                        if (index >= 0 && che[index] % pr[j] != 0)
                            count++;

                        break;
                    }
                }
            }

            writer.WriteLine(count);
            writer.Flush();
        }

        private static int Next()
        {
            int c;
            int res = 0;
            do
            {
                c = reader.Read();
                if (c == -1)
                    return res;
            } while (c < '0' || c > '9');
            res = c - '0';
            while (true)
            {
                c = reader.Read();
                if (c < '0' || c > '9')
                    return res;
                res *= 10;
                res += c - '0';
            }
        }
    }
}

using System;
using System.Collections.Generic;
namespace _26A
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            bool[] prime = new bool[n + 1];
            for (int i = 2; i <= n; i++) prime[i] = true;
            for (int i = 2; i * i <= n; i++)
                if (prime[i])
                    for (int j = i * i; j <= n; j += i)
                        prime[j] = false;
            List<int> primes = new List<int>();
            for (int i = 2; i <= n; i++)
                if (prime[i])
                    primes.Add(i);
            int result = 0;
            for (int i = 6; i <= n; i++)
            {
                int cnt = 0;
                foreach (var x in primes)
                {
                    if (x > i) break;
                    if (i % x == 0)
                        cnt++;
                }
                if (cnt == 2)
                    result++;
            }
            Console.WriteLine(result);
        }
    }
}

#if DEBUG
using System.Reflection;
using System.Threading.Tasks;
#endif

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Numerics;
using System.Globalization;

namespace _26a
{
    class Program
    {
        static string _inputFilename = "input.txt";
        static string _outputFilename = "output.txt";
        static bool _useFileInput = false;

        static void Main(string[] args)
        {
            StreamWriter file = null;
#if DEBUG
			Console.SetIn(getInput());
#else
            if (_useFileInput)
            {
                Console.SetIn(File.OpenText(_inputFilename));
                file = new StreamWriter(_outputFilename);
                Console.SetOut(file);
            }
#endif

            try
            {
                solution();
            }
            finally
            {
                if (_useFileInput)
                {
                    file.Close();
                }
            }
        }

        static void solution()
        {
            #region SOLUTION
            var n = readInt();
            var res = 0;
            for (int i = 2; i <= n; i++)
            {
                var num = i;
                var dc = 0;
                var sq = Math.Ceiling(Math.Sqrt(i));
                for (int j = 2; j <= sq; j++)
                {
                    if (num % j == 0)
                    {
                        dc++;
                    }

                    while (num % j == 0)
                    {
                        num /= j;
                    }
                }

                if (num != 1)
                {
                    dc++;
                }

                if (dc == 2)
                {
                    res++;
                }
            }

            Console.WriteLine("{0}", res);

            //var n = readInt();
            //var m = readInt();

            //var a = readIntArray();
            //var b = readIntArray();
            #endregion
        }

        static int readInt()
        {
            return int.Parse(Console.ReadLine());
        }

        static long readLong()
        {
            return long.Parse(Console.ReadLine());
        }

        static int[] readIntArray()
        {
            return Console.ReadLine().Split(' ').Where(i => !string.IsNullOrEmpty(i)).Select(i => int.Parse(i)).ToArray();
        }

        static long[] readLongArray()
        {
            return Console.ReadLine().Split(' ').Where(i => !string.IsNullOrEmpty(i)).Select(i => long.Parse(i)).ToArray();
        }

#if DEBUG
		static StreamReader getInput()
		{
			var resName = Assembly.GetCallingAssembly().GetManifestResourceNames()[0];
			var resource = Assembly.GetCallingAssembly().GetManifestResourceStream(resName);

			return new StreamReader(resource);
		}
#endif
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Text.RegularExpressions;
using System.IO;
using System.Numerics;
using System.Globalization;
using System.Threading;

namespace probleme {
    class Program {
        static void Main(string[] args) {

            //Console.SetIn(new StreamReader("file.in"));
            /*
            FileStream filestream = new FileStream("out.txt", FileMode.Create);
            var streamwriter = new StreamWriter(filestream);
            streamwriter.AutoFlush = true;
            Console.SetOut(streamwriter);
            */

            int n = int.Parse(Console.ReadLine());
            int[] sieve = new int[n + 1];
            int ans = 0;
            for (int i = 2; i <= n; i++) {
                if (sieve[i] == 0) {
                    for (int j = i + i; j <= n; j += i) {
                        sieve[j]++;
                    }
                } else if (sieve[i] == 2) {
                    ans++;
                }
            }
            Console.Write(ans);

            //Console.ReadKey();
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace qiw
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            List<int> oi = new List<int>();
            List<int> f = new List<int>();
            oi.Add(2);
            int count = 0;
            for (int i = 2; i <= n; i++)
            {
                for (int k =3; k <= i; k++)
                {
                    if (i%k==0)
                    {
                        count++;
                    }
                }
                if (count==1 && i!=4)
                {
                    oi.Add(i);

                }
                count = 0;
            }
            for (int i = 1; i <= n; i++)
            {
                for (int k = 0; k < oi.Count; k++)
                {
                    if (i%oi[k]==0)
                    {
                        count++;
                    }
                }
                if (count==2)
                {
                    f.Add(i);
                }
                count = 0;
            }
            Console.WriteLine(f.Count);

        }
    }
}

using System;
using System.Collections.Generic;
using System.IO;

namespace prA {

    class Program {
#if ONLINE_JUDGE
        private static readonly StreamReader reader = new StreamReader(Console.OpenStandardInput(1024 * 10), System.Text.Encoding.ASCII, false, 1024 * 10);
        private static readonly StreamWriter writer = new StreamWriter(Console.OpenStandardOutput(1024 * 10), System.Text.Encoding.ASCII, 1024 * 10);
#else
        private static readonly StreamWriter writer = new StreamWriter("output");
        private static readonly StreamReader reader = new StreamReader("input");
#endif
        static void Main(string[] args) {
            int n = Next();
            int ans = 0;
            bool[] nprimes = new bool[3000 + 1];
            nprimes[1] = true;
            for(int i = 2; i <= 3000; i++) {
                if(nprimes[i])
                    continue;
                for(int j = 2 * i; j <= 3000; j += i) {
                    nprimes[j] = true;
                }
            }
            for(int i = 1; i <= n; i++) {
                int count = 0;
                for(int j = 2; j <= i; j++) {
                    if(nprimes[j])
                        continue;
                    if(i % j != 0)
                        continue;
                    count++;
                }
                if(count == 2)
                    ans++;
            }
            writer.Write(ans);
            writer.Flush();
#if !ONLINE_JUDGE
            writer.Close();
#endif
        }
        private static int Next() {
            int c;
            int res = 0;
            do {
                c = reader.Read();
                if(c == -1)
                    return res;
            } while(c != '-' && (c < '0' || c > '9'));
            int sign = 1;
            if(c == '-') {
                sign = -1;
                c = reader.Read();
            }
            res = c - '0';
            while(true) {
                c = reader.Read();
                if(c < '0' || c > '9')
                    return res * sign;
                res *= 10;
                res += c - '0';
            }
        }
    }
}

using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;

// (づ°ω°)づﾐe★゜・。。・゜゜・。。・゜☆゜・。。・゜゜・。。・゜
public class Solver
{
    public void Solve()
    {
        int n = ReadInt();
        int ans = 0;
        for (int i = 6; i <= n; i++)
        {
            int x = i;
            int c = 0;
            for (int j = 2; j * j <= i; j++)
                if (x % j == 0)
                {
                    while (x % j == 0)
                        x /= j;
                    c++;
                }
            if (x > 1)
                c++;
            if (c == 2)
                ans++;
        }
        Write(ans);
    }

    #region Main

    protected static TextReader reader;
    protected static TextWriter writer;
    static void Main()
    {
#if DEBUG
        reader = new StreamReader("..\\..\\input.txt");
        //reader = new StreamReader(Console.OpenStandardInput());
        writer = Console.Out;
        //writer = new StreamWriter("..\\..\\output.txt");
#else
        reader = new StreamReader(Console.OpenStandardInput());
        writer = new StreamWriter(Console.OpenStandardOutput());
        //reader = new StreamReader("input.txt");
        //writer = new StreamWriter("output.txt");
#endif
        try
        {
            new Solver().Solve();
            //var thread = new Thread(new Solver().Solve, 1024 * 1024 * 128);
            //thread.Start();
            //thread.Join();
        }
        catch (Exception ex)
        {
            Console.WriteLine(ex);
#if DEBUG
#else
            throw;
#endif
        }
        reader.Close();
        writer.Close();
    }

    #endregion

    #region Read / Write
    private static Queue<string> currentLineTokens = new Queue<string>();
    private static string[] ReadAndSplitLine() { return reader.ReadLine().Split(new[] { ' ', '\t', }, StringSplitOptions.RemoveEmptyEntries); }
    public static string ReadToken() { while (currentLineTokens.Count == 0)currentLineTokens = new Queue<string>(ReadAndSplitLine()); return currentLineTokens.Dequeue(); }
    public static int ReadInt() { return int.Parse(ReadToken()); }
    public static long ReadLong() { return long.Parse(ReadToken()); }
    public static double ReadDouble() { return double.Parse(ReadToken(), CultureInfo.InvariantCulture); }
    public static int[] ReadIntArray() { return ReadAndSplitLine().Select(int.Parse).ToArray(); }
    public static long[] ReadLongArray() { return ReadAndSplitLine().Select(long.Parse).ToArray(); }
    public static double[] ReadDoubleArray() { return ReadAndSplitLine().Select(s => double.Parse(s, CultureInfo.InvariantCulture)).ToArray(); }
    public static int[][] ReadIntMatrix(int numberOfRows) { int[][] matrix = new int[numberOfRows][]; for (int i = 0; i < numberOfRows; i++)matrix[i] = ReadIntArray(); return matrix; }
    public static int[][] ReadAndTransposeIntMatrix(int numberOfRows)
    {
        int[][] matrix = ReadIntMatrix(numberOfRows); int[][] ret = new int[matrix[0].Length][];
        for (int i = 0; i < ret.Length; i++) { ret[i] = new int[numberOfRows]; for (int j = 0; j < numberOfRows; j++)ret[i][j] = matrix[j][i]; } return ret;
    }
    public static string[] ReadLines(int quantity) { string[] lines = new string[quantity]; for (int i = 0; i < quantity; i++)lines[i] = reader.ReadLine().Trim(); return lines; }
    public static void WriteArray<T>(IEnumerable<T> array) { writer.WriteLine(string.Join(" ", array)); }
    public static void Write(params object[] array) { WriteArray(array); }
    public static void WriteLines<T>(IEnumerable<T> array) { foreach (var a in array)writer.WriteLine(a); }
    private class SDictionary<TKey, TValue> : Dictionary<TKey, TValue>
    {
        public new TValue this[TKey key]
        {
            get { return ContainsKey(key) ? base[key] : default(TValue); }
            set { base[key] = value; }
        }
    }
    private static T[] Init<T>(int size) where T : new() { var ret = new T[size]; for (int i = 0; i < size; i++)ret[i] = new T(); return ret; }
    #endregion
}

using System;
using System.Collections.Generic;
using System.Linq;
class Program
{
    static int[] GetPrimeFactors(int n)
    {
        var F = new List<int>();
        while (n != 1)
        {
            var p = trial_division(n);
            var e = 1;
            n /= p;
            while (n % p == 0)
            {
                e += 1;
                n /= p;
            }
            F.Add(p);
        }
        return F.ToArray();
    }
    static int trial_division(int n, int bound = 0)
    {
        if (n == 1) return 1;
        var a = new int[] { 2, 3, 5 };
        foreach (var p in a)
        {
            if (n % p == 0) return p;
        }
        if (bound == 0) bound = n;
        int[] dif = { 6, 4, 2, 4, 2, 4, 6, 2 };
        var m = 7;
        var i = 1;
        while (m <= bound && m * m <= n)
        {
            if (n % m == 0)
                return m;
            m += dif[i % 8];
            i += 1;
        }
        return n;
    }
    static void Main()
    {
        var n = int.Parse(Console.ReadLine());
        int c = 0;
        foreach (var item in Enumerable.Range(1, n))
        {
            var p = GetPrimeFactors(item);
            c += p.Length == 2 ? 1 : 0;
        }
        Console.WriteLine(c);
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp37
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());

            int c = 0;
            if (n < 4)
            {
                Console.WriteLine(0);
            }
            else
            {

                List<int> primes = new List<int>();
                for (int i = 2; i < n; i++)
                {
                    int sqrt = Convert.ToInt32(Math.Sqrt(i));
                    bool check = true;
                    for (int j = 2; j <= sqrt; j++)
                    {
                        if (i%j==0)
                        {
                            check = false;
                            break;
                        }
                    }
                    if (check)
                    {
                        primes.Add(i);
                    }

                }
                for (int i = 4; i <= n; i++)
                {
                    int u = 0;
                    int sqrt = Convert.ToInt32(Math.Sqrt(i));
                    for (int j = 0; j < primes.Count ; j++)
                    {
                        if (i%primes[j]==0)
                        {
                            u++;
                        }
                    }
                    if (u==2)
                    {
                        c++;
                    }
                }
                Console.WriteLine(c);
            }
        }
    }
}

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

namespace codeforces
{
	class Program
	{
		public const int Osn = 1000000007;

		public class Pair
		{
			public int First;

			public int Second;
		}

		public class PairComparer : IComparer<Pair>
		{
			public int Compare(Pair x, Pair y)
			{
				if (x.First > y.First || (x.First == y.First && x.Second < y.Second))
					return -1;
				return 1;
			}
		}

		public static long GetGcd(long a, long b)
		{
			while (true)
			{
				if (b == 0)
					return a;
				var a1 = a;
				a = b;
				b = a1 % b;
			}
		}

		public static void WriteYesNo(bool x, string yes = "YES", string no = "NO")
		{
			if (x)
				Console.WriteLine(yes);
			else
			{
				Console.WriteLine(no);
			}
		}

		public static string ReadString()
		{
			return Console.ReadLine();
		}

		public static List<int> ReadListOfInts()
		{
			var s = Console.ReadLine();
			return s.Split(' ').Select(int.Parse).ToList();
		}

		public static List<long> ReadListOfLongs()
		{
			var s = Console.ReadLine();
			return s.Split(' ').Select(long.Parse).ToList();
		}

		public static int ReadInt()
		{
			var s = Console.ReadLine();
			return int.Parse(s);
		}

		public static long ReadLong()
		{
			var s = Console.ReadLine();
			return long.Parse(s);
		}

		public class Vertex
		{
			public int Was;

			public List<Pair> Edges;
		}

		public static List<List<Vertex>> Graph = new List<List<Vertex>>();

		public static bool Dfs(int x, int y, int prevx, int prevy)
		{
			Graph[x][y].Was = 1;
			var result = false;
			foreach (var t in Graph[x][y].Edges)
			{
				if (Graph[t.First][t.Second].Was == 0)
					result |= Dfs(t.First, t.Second, x, y);
				else if (t.First != prevx || t.Second != prevy)
					return true;
			}

			return result;
		}

		public static bool IsPrime(int x)
		{
			for (var j = 2; j * j <= x; ++j)
				if (x % j == 0)
					return false;
			return true;
		}

		private static void Main()
		{
			var n = ReadInt();
			var ans = 0;
			var primes = new List<int>();
			for (var i = 2; i <= n; ++i)
				if (IsPrime(i))
					primes.Add(i);
			for (var i = 6; i <= n; ++i)
			{
				var ct = 0;
				for (var j = 0; j < primes.Count; ++j)
					if (i % primes[j] == 0)
						ct++;
				if (ct == 2)
					ans++;
			}
			Console.WriteLine(ans);
			Console.ReadLine();
		}
	}
}

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

class Program
{
    static void Main(string[] args)
    {
        //var input = Console.ReadLine().Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
        //var n = int.Parse(input[0]);
        //var m = int.Parse(input[1]);

        var n = int.Parse(Console.ReadLine());

        var primes = new List<int> {2, 3};

        for (int i = 5; i < 3000; i++)
        {
            if (primes.All(p => i%p != 0))
            {
                primes.Add(i);
            }
        }

        var res = 0;

        for (int i = 2; i <= n; i++)
        {
            var lc = 0;

            for (int j = 0; j < primes.Count; j++)
            {
                if (i%primes[j]==0)
                {
                    lc++;
                }

                if (lc > 2) break;
            }

            if (lc == 2)
            {
                res++;
            }
        }

        Console.WriteLine(res);
    }
}

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

namespace MakeCalendar
{
    public static class MainClass
    {

        static int ReadIntLine()
        {
            return int.Parse(Console.ReadLine());
        }

        static void ReadInt(ref int a)
        {
            a = ReadIntArrayLine()[0];
        }

        static void ReadInts(ref int a, ref int b)
        {
            var x = ReadIntArrayLine();
            a = x[0]; b = x[1];
        }

        static void ReadInts(ref int a, ref int b, ref int c)
        {
            var x = ReadIntArrayLine();
            a = x[0]; b = x[1]; c = x[2];
        }

        static void ReadInts(ref int a, ref int b, ref int c, ref int d)
        {
            var x = ReadIntArrayLine();
            a = x[0]; b = x[1]; c = x[2]; d = x[3];
        }

        static void ReadInts(ref int a, ref int b, ref int c, ref int d, ref int e)
        {
            var x = ReadIntArrayLine();
            a = x[0]; b = x[1]; c = x[2]; d = x[3]; e = x[4];
        }

        static void ReadInts(ref int a, ref int b, ref int c, ref int d, ref int e, ref int f)
        {
            var x = ReadIntArrayLine();
            a = x[0]; b = x[1]; c = x[2]; d = x[3]; e = x[4]; f = x[5];
        }

        static int[] ReadIntArrayLine()
        {
            char[] sep = { ' ' };
            return Console.ReadLine().Split(sep, StringSplitOptions.RemoveEmptyEntries).Select(x => int.Parse(x)).ToArray();
        }

        static void PrintLn(object obj)
        {
            Console.WriteLine(obj.ToString());
        }

        public static string Reverse(string s)
        {
            char[] charArray = s.ToCharArray();
            Array.Reverse(charArray);
            return new string(charArray);
        }

        public static void PrintLnCollection<T>(IEnumerable<T> col)
        {
            PrintLn(string.Join(" ", col));
        }

        public static void PrintLn(params object[] v)
        {
            PrintLnCollection(v);
        }

        public static string ReadLine()
        {
            return Console.ReadLine();
        }

        public static string MySubstring(this string str, int start, int finish)
        {
            if (start > finish) return "";
            return str.Substring(start, finish - start + 1);
        }

        public static bool IsInRange(this int a, int lb, int ub)
        {
            return (a >= lb) && (a <= ub);
        }

        private static void mergeDS(int i, int j, int[] a)
        {
            int t = a[j];
            for (int ii = 0; ii < a.Length; ii++)
            {
                if (a[ii] == t)
                    a[ii] = a[i];
            }
        }

        private static T MyMax<T>(params T[] a)
        {
            return a.Max();
        }

        private static T MyMin<T>(params T[] a)
        {
            return a.Min();
        }

        private static int[] GetPrimesLessThan(int x)
        {
            if (x < 2)
                return new int[0];

            int[] a = new int[x];

            a[0] = 1; a[1] = 1;

            for (int i = 0; i < a.Length; i++)
            {
                if (a[i] == 0)
                    for (int j = 2 * i; j < a.Length; j += i)
                    {
                        a[j] = 1;
                    }
            }

            var abc = new List<int>(x);

            for (int i = 0; i < a.Length; i++)
            {
                if (a[i] == 0)
                    abc.Add(i);
            }

            return abc.ToArray();
        }

        private static int FindNearestLEQElementInTheArray(int[] a, int startIndex, int endIndex, int target)
        {
            if (startIndex == endIndex)
            {
                if (a[startIndex] <= target)
                    return startIndex;
                else
                    return -1;
            }

            if (startIndex + 1 == endIndex)
            {
                if (a[endIndex] <= target)
                    return endIndex;
                else if (a[startIndex] <= target)
                    return startIndex;
                else
                    return -1;
            }

            int mid = (startIndex + endIndex) / 2;
            if (target == a[mid])
                return mid;
            else if (target < a[mid])
                return FindNearestLEQElementInTheArray(a, startIndex, mid - 1, target);
            else
                return FindNearestLEQElementInTheArray(a, mid, endIndex, target);
        }

        private static int FindNearestLEQElementInTheArray(int[] a, int target)
        {
            return FindNearestLEQElementInTheArray(a, 0, a.Length - 1, target);
        }

        private static int gcd(int a, int b)
        {
            int r = a % b;
            while (r != 0)
            {
                a = b;
                b = r;
                r = a % b;
            }
            return b;
        }

        //----------------------------------------------------------------------------

        static void Main(string[] args)
        {
            int n = ReadIntLine();

            int[] s = new int[n + 1];

            for (int i = 2; i < s.Length; i++)
            {
                if (s[i] == 0)
                {
                    for (int j = i; j < s.Length; j+=i)
                    {
                        s[j]++;
                    }
                }
            }

            PrintLn(s.Count(x => x == 2));

        }

    }

}

using System;
class Test {
    public static void Main(){
        int n = Int32.Parse(Console.ReadLine());
        int [] aP = new int[n];
        aP[0] = 2;
        int k = 1;
        for(int i = 0 ; i<= n ; i++){
            for(int j = 2 ; j< i ; j++){
                if( i%j == 0 ){
                    break;
                }
                if(j == i-1){
                    aP[k] = i;
                    k++;
                }
            }
        }
        int m = Array.IndexOf(aP,0);
        int ans = 0;
        for(int a = 0 ; a < m ; a++ ){
            for(int b = 0 ; b < m ; b++){
                int tmp = aP[a]*aP[b];
                if( tmp <= n){
                    if(a != b){
                        ans += n/tmp ;
                    }
                }
            }
        }
        Console.WriteLine(ans/2);
    }
}

using System;
class Test {
    public static void Main(){
        int n = Int32.Parse(Console.ReadLine());
        int [] aP = new int[n];
        aP[0] = 2;
        int k = 1;
        for(int i = 0 ; i<= n ; i++){
            for(int j = 2 ; j< i ; j++){
                if( i%j == 0 ){
                    break;
                }
                if(j == i-1){
                    aP[k] = i;
                    k++;
                }
            }
        }
        int m = Array.IndexOf(aP,0);
        int ans = 0;
        for(int a = 0 ; a < m ; a++ ){
            for(int b = 0 ; b < m ; b++){
                if(aP[a]*aP[b] <= n){
                    if(a != b){Console.WriteLine(aP[a]*aP[b]);
                        ans++;
                    }
                }
            }
        }
        Console.WriteLine(ans/2);
    }
}

using System;
class Test {
    public static void Main(){
        int n = Int32.Parse(Console.ReadLine());
        int [] aP = new int[n];
        aP[0] = 2;
        int k = 1;
        for(int i = 0 ; i<= n ; i++){
            for(int j = 2 ; j< i ; j++){
                if( i%j == 0 ){
                    break;
                }
                if(j == i-1){
                    aP[k] = i;
                    k++;
                }
            }
        }
        int m = Array.IndexOf(aP,0);
        int ans = 0;
        for(int a = 6 ; a <= n ; a++ ){
           int num = 0;
           for(int b = 0 ; b<m ; b++){
               if(a%aP[b] == 0){
                   if(num == 3){
                       b = m;
                       break;
                   }
                   num++;
               }
               if(b == m-1 && num >= 2 ){
                   ans++;
               }
           }

        }
        Console.WriteLine(ans);
    }
}

using System;
class Test {
    public static void Main(){
        int n = Int32.Parse(Console.ReadLine());
        int [] aP = new int[n];
        aP[0] = 2;
        int k = 1;
        for(int i = 0 ; i<= n ; i++){
            for(int j = 2 ; j< i ; j++){
                if( i%j == 0 ){
                    break;
                }
                if(j == i-1){
                    aP[k] = i;
                    k++;
                }
            }
        }
        int m = Array.IndexOf(aP,0);
        int ans = 0;
        for(int a = 0 ; a < m ; a++ ){
            for(int b = 0 ; b < m ; b++){
                if(aP[a]*aP[b] <= n){
                    if(a != b){
                        ans++;
                    }
                }
            }
        }
        Console.WriteLine(ans/2);
    }
}

using System;
class Test {
    public static void Main(){
        int n = Int32.Parse(Console.ReadLine());
        int [] aP = new int[n];
        aP[0] = 2;
        int k = 1;
        for(int i = 0 ; i<= n ; i++){
            for(int j = 2 ; j< i ; j++){
                if( i%j == 0 ){
                    break;
                }
                if(j == i-1){
                    aP[k] = i;
                    k++;
                }
            }
        }
        int m = Array.IndexOf(aP,0);
        int ans = 0;
        for(int a = 0 ; a <= n ; a++ ){
           int num = 0;
           for(int b = 0 ; b<m ; b++){
               if(a%aP[b] == 0){
                   if(num >= 3){
                       b = m;
                       break;
                   }
                   num++;
               }
               if(b == m-1 && num == 2 ){
                   ans++;
               }
           }

        }
        Console.WriteLine(ans);
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Threading;
using System.Numerics;
using System.Globalization;

namespace JalalHani
{
    class Vertex
    {
        public List<int> relations = new List<int>();
        public List<int> weights = new List<int>();
        public Vertex(int r , int w)
        {
            this.relations.Add(r);
            this.weights.Add(w);
        }
        public void AddInfo (int r, int w)
        {
            this.relations.Add(r);
            this.weights.Add(w);
        }
        ////Dijkstra
        //int[] data = Console.ReadLine().Split().Select(s => int.Parse(s)).ToArray();
        //int n = data[0], m = data[1];
        //Dictionary<int, Vertex> Edges = new Dictionary<int, Vertex>();
        //for (int i = 0; i < m; i++)
        //{
        //    data = Console.ReadLine().Split().Select(s => int.Parse(s)).ToArray();
        //    int k = data[0], r = data[1], w = data[2];
        //    if (Edges.Keys.Contains(k))
        //    {
        //        Edges[k].AddInfo(r,w);
        //    }
        //    else
        //    {
        //        Edges.Add(k, new Vertex(r, w));
        //    }
        //}

        //foreach (var edge in Edges)
        //{

        //}
    }

    class Program
    {

        public static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            List<int> values = new List<int>();
            long o = 0;

            for (int i = 6; i <= n; i++)
            {
                double t = (double)i/2;
                t = Math.Ceiling(t) - 1;
                var y = Enumerable.Range(2, (int)t).Where(x => i % x == 0).ToArray();
                Console.WriteLine(i + " : " + string.Join(" " , y));
                if (y.Count() > 1)
                {
                    if (y.Where(x=>IsPrime(x)).Count() == 2)
                    {
                        values.Add(i);
                    }
                }
            }

            Console.WriteLine(values.Count);
        }

        static bool IsPrime (int i)
        {
            if (i < 4) return true;
            for (int j = 2; j <= (int)Math.Ceiling(Math.Sqrt(i)); j++)
            {
                if (i % j == 0)
                    return false;
            }
            return true;
        }

        static int Test(int v , int m)
        {
            int p1 = 0;
            int dif = (int)Math.Ceiling((double)m / v);
            int diff = v * dif;
            p1 = (diff - m);
            p1 += dif == 2 ? 1 : dif;

            return p1;
        }

        static void MulticasesQuestion()
        {
            int t = int.Parse(Console.ReadLine());
            for (int i = 0; i < t; i++)
                SolveTestCase();
        }
        static void SolveTestCase()
        {

        }
        static int GCD(int a1, int a2)
        {
            int mx = Math.Max(a1, a2);
            int mn = Math.Min(a1, a2);

            if (mx % mn == 0)
            {
                return mn;
            }
            else GCD(mn, mx % mn);
            return 1;
        }

        static BigInteger Pow(int b, int a)
        {
            BigInteger x = 1;

            for (int i = 0; i < a; i++)
            {
                x *= b;
            }

            return x;
        }
        static void LeastCostBracketSequence()
        {
            var input = Console.ReadLine().ToCharArray();
            var isSolutionExists = true;
            long totalCost = 0;
            var balance = 0;

            var sortedVariants = new List<Variant>();
            var comparer = new ByCostSwitch();

            for (var i = 0; i < input.Length; i++)
            {
                if (input[i] == '(')
                {
                    balance++;
                }
                else if (input[i] == ')')
                {
                    balance--;
                }
                else
                {
                    var costValue = Console.ReadLine().Split(' ').Select(a => int.Parse(a)).ToArray();
                    var variant = new Variant()
                    {
                        CostSwitch = costValue[0] - costValue[1],
                        Position = i
                    };

                    var index = sortedVariants.BinarySearch(variant, comparer);
                    if (index < 0)
                    {
                        index = ~index;
                    }

                    sortedVariants.Insert(index, variant);

                    totalCost += costValue[1];
                    balance--;
                }

                if (balance < 0)
                {
                    if (sortedVariants.Count == 0)
                    {
                        isSolutionExists = false;
                        break;
                    }

                    var sortedVariant = sortedVariants[0];

                    input[sortedVariant.Position] = '(';
                    totalCost += sortedVariant.CostSwitch;
                    balance += 2;
                    sortedVariants.RemoveAt(0);
                }
            }

            isSolutionExists = (balance == 0);

            if (isSolutionExists)
            {
                Console.WriteLine(totalCost);
                for (var i = 0; i < input.Length; i++)
                {
                    if (input[i] == '?')
                    {
                        Console.Write(')');
                    }
                    else
                    {
                        Console.Write(input[i]);
                    }
                }
                Console.WriteLine();
            }
            else
            {
                Console.WriteLine("-1");
            }
        }
        class Commands
        {
            public static int[] NextIntArray
            {
                get
                {
                    return Console.ReadLine().Split().Select(int.Parse).ToArray();
                }
            }
            public static List<int> NextIntList
            {
                get
                {
                    return Console.ReadLine().Split().Select(int.Parse).ToList();
                }
            }
            public static int[] NextSortedIntArray
            {
                get
                {
                    return Console.ReadLine().Split().Select(int.Parse).OrderBy(x => x).ToArray();
                }
            }
            public static int[] NextDescSortedIntArray
            {
                get
                {
                    return Console.ReadLine().Split().Select(int.Parse).OrderByDescending(x => x).ToArray();
                }
            }
            public static long[] NextLongArray
            {
                get
                {
                    return Console.ReadLine().Split().Select(long.Parse).ToArray();
                }
            }
            public static List<long> NextLongList
            {
                get
                {
                    return Console.ReadLine().Split().Select(long.Parse).ToList();
                }
            }
            public static long[] NextSortedLongArray
            {
                get
                {
                    return Console.ReadLine().Split().Select(long.Parse).OrderBy(x => x).ToArray();
                }
            }
            public static long[] NextDescSortedLongArray
            {
                get
                {
                    return Console.ReadLine().Split().Select(long.Parse).OrderByDescending(x => x).ToArray();
                }
            }
            public static int NextInt
            {
                get
                {
                    return int.Parse(Console.ReadLine());
                }
            }

            public static string NextString
            {
                get { return Console.ReadLine(); }
            }
        }

        private class Variant
        {
            public int CostSwitch;
            public int Position;
        }

        private class ByCostSwitch : IComparer<Variant>
        {
            #region IComparer implementation
            public int Compare(Variant x, Variant y)
            {
                return x.CostSwitch.CompareTo(y.CostSwitch);
            }
            #endregion
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication1
{
    class A26_AlmostPrime
    {
        public static void Main()
        {
            int[] prime = { 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53 };
            int n = int.Parse(Console.ReadLine());
            int subptie = 0;

            for(int i = n; i > 5; i--)
            {
                int count = 0;
                for (int j = 0; j < prime.Length; j++)
                {
                    if (i % prime[j] == 0)
                        count++;

                    if (count > 2)
                    {
                        count = 0;
                        break;
                    }
                }
                if (count == 2)
                    subptie++;
            }
            Console.WriteLine(subptie);
        }
    }
}

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

namespace CF_026A {
    class Program {
        static void Main(string[] args) {
            //gen p
            int[] p=new int[1000]; p[0]=2;
            int u=1,t=3,j; while(t<3000) { p[u]=t; j=1; while(t%p[j]!=0) j++; if(j==u) u++; t+=2; }
            int o=0,n=int.Parse(Console.ReadLine()),i=1;
            for(;p[i]*p[i-1]<=n;o+=i,i++) ;
            for(j=i-1;j>=0;j--) if(p[j]*p[i]<=n) o++;
            Console.WriteLine(o);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
namespace Task26A
{
    class Program
    {
        static void Main(string[] args)
        {
            int n, ans = 0;
            n = Convert.ToInt32(Console.ReadLine());
            List <int>  primes=new List <int> ();
            for(int i = 2; i <= n; i++)
                if (isPrime(i))
                    primes.Add(i);

            for (int i = 1; i <= n; i++)
                if (isAlmastPrime(ref primes,i))
                    ans++;

            Console.WriteLine(ans);
        }

         private static bool isPrime(int N)
        {
            if (N == 2) return true;
            if (N < 2 || N % 2 == 0) return false;
            for (int i = 3; i <=Math.Sqrt(N); i += 2)
                if (N % i == 0) return false;
            return true;
        }

          private static bool isAlmastPrime(ref List<int> mylist, int item)
        {
            int count = 0;
            for (int i = 0; i <mylist.Count; i++) {

                if (i%mylist[i]== 0)
                    count++;
                if (count > 2)
                    return false;
              }
            return count == 2;
        }

    }
}

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

namespace Task26A
{
    class Program
    {
        static void Main(string[] args)
        {
            int N = int.Parse(Console.ReadLine());
            List<int> Primes = new List<int>();
            for (int i = 2; i <= N; i++)
                if (IsPrime(i)) Primes.Add(i);

            int ans = 0;
            for (int i = 6; i <= N; i++)
                if (IsAlmostPrime(i, ref Primes)) ans++;

            Console.WriteLine(ans);

        }
        private static bool IsAlmostPrime(int n, ref List<int> pNums)
        { int countDivisor = 0;
            for (int i = 0; i < pNums.Count; i++)
            {   if (pNums[i] >= n) break;
                if (n % pNums[i] == 0) countDivisor++;
            }
            return countDivisor == 2;
        }
        private static bool IsPrime(int n)
        {

            if (n == 2 ) return true;
            if (n <= 1|| n%2==0)
                return false;

            //for (int i = 2; i <= n/2; i++)
            //    if (n % i == 0)
            //        return false;

            for (int i = 3; i < Math.Sqrt(n); i+=2)
                if (n % i == 0)
                    return false;

            return true;
        }

    }
}

using System;

class P {
  static void Main() {
    var n = int.Parse(Console.ReadLine());
    var nDiv = new int[n+1];
    for (var i = 2 ; i <= n ; i++) if (nDiv[i] == 0)
      for (var j = i; j <= n; j++) nDiv[j]++;
    var count = 0;
    for (var i = 2; i <= n; i++) if (nDiv[i] == 2) count++;
    Console.Write(count);
  }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication8
{
    class Program
    {
        static void Main(string[] args)
        {
            const int max_number=3000;
            bool[] isPrime = new bool[max_number+1];
            int n = int.Parse(Console.ReadLine());
            for (int i = 2; i <= n; i++) isPrime[i] = true;
            int max_factor=(int)Math.Sqrt(n);
            for (int i = 2; i <= max_factor; i++)
                if (isPrime[i])
                    for (int j = i * i; j <= n; j += i) isPrime[j] = false;

            int count = 0;
            for (int j = 2; j <= n; j++)
            {
                max_factor = (int)Math.Sqrt(j);
                for (int i = 2; i <= max_factor; i++)
                    if (j % i == 0 && isPrime[i] && isPrime[j / i] && i!=j/i)
                    {
                        count++;
                        break;
                    }

            }
              Console.WriteLine(count);

        }
    }
}

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;

namespace Almost_Prime
{
    internal class Program
    {
        private static readonly StreamReader reader = new StreamReader(Console.OpenStandardInput(1024*10), Encoding.ASCII, false, 1024*10);
        private static readonly StreamWriter writer = new StreamWriter(Console.OpenStandardOutput(1024*10), Encoding.ASCII, 1024*10);

        private static void Main(string[] args)
        {
            int n = Next();

            var pr = new List<int> {2, 3};
            for (int i = 5; i < n; i += 2)
            {
                if (pr.All(j => i%j != 0))
                    pr.Add(i);
            }

            int count = 0;
            for (int i = 6; i <= n; i++)
            {
                for (int j = 0; j < pr.Count; j++)
                {
                    if (i%pr[j] == 0)
                    {
                        int o = i/pr[j];
                        int index = pr.BinarySearch(o);
                        if (index >= 0 && index != j)
                            count++;

                        break;
                    }
                }
            }

            writer.WriteLine(count);
            writer.Flush();
        }

        private static int Next()
        {
            int c;
            int res = 0;
            do
            {
                c = reader.Read();
                if (c == -1)
                    return res;
            } while (c < '0' || c > '9');
            res = c - '0';
            while (true)
            {
                c = reader.Read();
                if (c < '0' || c > '9')
                    return res;
                res *= 10;
                res += c - '0';
            }
        }
    }
}