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.

import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.IOException;
import java.util.StringTokenizer;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskA solver = new TaskA();
        solver.solve(1, in, out);
        out.close();
    }
}

class TaskA {
    public void solve(int testNumber, InputReader in, PrintWriter out) {
        int n = in.nextInt();
        int count = 0;
        for (int i = 1; i <= n; i++) {
            if (almostPrime(i)) ++count;
        }
        out.println(count);
    }

    boolean almostPrime(int n) {
        return factorize(n) == 2;
    }

    public int factorize(int n) {
        int count = 0;
        for (int d = 2; n > 1; ) {
            int power = 0;
            while (n % d == 0) {
                ++power;
                n /= d;
            }
            if (power > 0) {
                ++count;
            }
            ++d;
            if (d * d > n) {
                d = n;
            }
        }
        return count;
    }
}

class InputReader {
    public BufferedReader reader;
    public StringTokenizer tokenizer;

    public InputReader(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream), 32768);
        tokenizer = null;
    }

    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

    public int nextInt() {
        return Integer.parseInt(next());
    }

}

import java.io.*;
import java.util.*;
import java.math.*;
import static java.lang.Math.*;
import static java.lang.Integer.parseInt;
import static java.lang.Long.parseLong;
import static java.lang.Double.parseDouble;
import static java.lang.String.*;

public class Main {

    static List<Integer>[] g;
    static boolean vis[];
    static boolean[] isPrime;

    public static void main(String[] args) throws IOException {
//        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));//(new FileReader("input.in"));
        StringBuilder out = new StringBuilder();
//        StringTokenizer tk;
//        tk = new StringTokenizer(in.readLine());
        //Scanner reader = new Scanner(System.in);
        Reader.init(System.in);
        int n = Reader.nextInt();
        int c = 0;
        for (int i = 0; i <= n; i++) {
            if (aprime(i)) {
                c++;
            }
        }
        System.out.println(c);

    }

    static boolean checkprime(long N) {
        long count = 0;
        for (int i = 1; i * i <= N; ++i) {
            if (N % i == 0) {
                if (i * i == N) {
                    count++;
                } else {
                    count += 2;
                }
            }
        }
        if (count == 2) {
            return true;
        } else {
            return false;
        }
    }

    static boolean aprime(int n) {
        int c = 0;
        for (int i = 1; i <= n; i++) {
            if (n % i == 0 && checkprime(i)) {
                c++;
            }
        }
        if (c == 2) {
            return true;
        } else {
            return false;
        }

    }

}

class Reader {

    static StringTokenizer tokenizer;
    static BufferedReader reader;

    public static void init(InputStream input) throws UnsupportedEncodingException {
        reader = new BufferedReader(new InputStreamReader(input, "UTF-8"));
        tokenizer = new StringTokenizer("");
    }

    public static String next() throws IOException {
        while (!tokenizer.hasMoreTokens()) {
            tokenizer = new StringTokenizer(reader.readLine());
        }
        return tokenizer.nextToken();
    }

    public static String nextLine() throws IOException {
        return reader.readLine();
    }

    public static int nextInt() throws IOException {
        return Integer.parseInt(next());
    }

    public static double nextDouble() throws IOException {
        return Double.parseDouble(next());
    }

    public static long nextLong() throws IOException {
        return Long.parseLong(next());
    }
}

import java.util.Scanner;

public class Problem26A {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();

		int[] sp = new int[n+1];
		int[] p = new int[n+1];
		int index = -1;
		int[] pnum = new int[n+1];

		for (int q = 2; q <= n; q++) {
			if (sp[q] == 0) {
				sp[q] = q;
				p[++index] = q;
				pnum[q] = 1;
			}

			for (int k = 0; (k <= index) && (p[k] <= sp[q]); k++) {
				if (p[k]*q > n) {
					break;
				}
				sp[p[k]*q] = p[k];
				pnum[p[k]*q] = pnum[q];
				if (p[k] != sp[q]) {
					pnum[p[k]*q]++;
				}
			}
		}

		int result = 0;
		for (int q = 2; q <= n; q++) {
			if (pnum[q] == 2) {
				result++;
			}
		}
		System.out.println(result);
	}
}

import java.util.*;
import java.lang.*;

public class AlmostPrime
{
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner sc=new Scanner(System.in);
		int[] a=new int[3001];
		int n=sc.nextInt();

		int k=0;
		for(int i=2;i<=n;i++)
		{
			if(a[i]==0)
			{
				for(int j=i;j<=n;j+=i)
				{
					a[j]++;
				}
			}
			if(a[i]==2)
			{
				k++;
			}
		}
		System.out.println(k);
	}
}

import java.util.ArrayList;
import java.util.Scanner;

public class A26 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int n = scanner.nextInt();

        ArrayList<Integer> primes = new ArrayList<Integer>();
        primes.add(2);
        for (int i = 3; i <= n; i++) {
            boolean check = true;

            for (int j = 2; j < i; j++) {
                if(i % j == 0) {
                    check = false;
                    break;
                }
            }

            if(check) {
                primes.add(i);
            }
        }

        int count = 0;
        for (int i = 1; i <= n; i++) {
            int localI = i;
            int deliteli = 0;

            if(!primes.contains(localI)) {
                for (int j = 0; j < primes.size(); j++) {
                    if (localI % primes.get(j) == 0) {
                        localI /= primes.get(j);
                        deliteli++;

                        if (deliteli > 2) {
                            break;
                        }
                    }
                }
            }
            if(deliteli == 2) {
                count++;
            }
        }

        System.out.println(count);
    }
}

import java.util.*;
public class Almost_Primes {

	static int LIM = 3001;

	public static void main(String[] args) {
		// TODO Auto-generated method stub

		Scanner s = new Scanner(System.in);

		int n = s.nextInt();
		int[] prime_factors = new int[LIM];

		for(int i=2;i<LIM;i++) {
			if(prime_factors[i]==0) {
				for(int j=i*2; j<LIM; j+=i) {
					prime_factors[j]+=1;
				}
			}
		}

		int res=0;
		for(int i=0; i<=n;i++) {
			if(prime_factors[i]==2)
				res+=1;
		}

		System.out.println(res);

		//displayRawArr(prime_factors);

	}

static void displayRawArr(int[] arr) {

		for(int i=0; i<arr.length; i++) {
			System.out.print(arr[i]+", ");
		}
		System.out.println();
	}

}

//package ivory.codeforces.contest26;
import java.util.Scanner;
import java.util.List;
import java.util.ArrayList;

public class A {
 public static void main ( String [] args ) {
  List<Integer> primes = new ArrayList<Integer>();
  for ( int i = 2 ;i < 3000 ; i ++ ) {
   boolean yes = true;
   for ( int Key : primes ) {
    if ( i % Key == 0 ) {
     yes = false;
    }
   }
   if ( yes ) {
    primes.add(i);
   }
  }

  List<Integer> ans = new ArrayList<Integer>();
  ans.add(0);
  for ( int i =1 ;i < 3001 ; i ++ ) {
   int num = 0 ;
   if ( ! primes.contains(i)) {
    int idx =0 ;
    int rnd = i ;
    while ( idx < primes.size() && primes.get(idx) <= rnd) {
     if (rnd % primes.get(idx) == 0) {
      while ( rnd % primes.get(idx) == 0 ) {
       rnd /= primes.get(idx);
      }
      num ++;
     }
     idx ++ ;
    }
   }
   if ( num == 2 ) {
    ans.add(ans.get(i-1)+1);
   } else {
    ans.add(ans.get(i-1));
   }
  }
  Scanner cin = new Scanner(System.in);
  while ( cin.hasNext() ) {
   int n = cin.nextInt();
   System.out.println(ans.get(n));
  }
 }
}

import java.util.*;
public class MyClass {

    static int MAX =3001;
    static int[] sieve()
    {
        boolean isp[]=new boolean[MAX];
        int check[]=new int[MAX];
        int c[]=new int[MAX];
        Arrays.fill(isp,true);
       // ArrayList<Integer> primes=new ArrayList<>();
        for(int i=2;i<MAX;i++)
        {
            if(isp[i])
            {
            for(int j=i;j<MAX;j+=i)
            {
                isp[j]=false;
                check[j]--;
               // primes.add(j);
            }
            }
        }
        c[0]=0;
        c[1]=0;
        c[2]=0;
        c[3]=0;
        c[4]=0;
        c[5]=0;
        int count=0;
        //primes.add
       // primes.add(new Integer("2"));
        for(int i=6;i<MAX;i++)
        {
            if(check[i]==-2)
            {c[i]=count+1;count++;}
            else
            c[i]=count;
        }
        return c;
    }

    public static void main(String args[])
    {
     Scanner in=new Scanner(System.in);
     int t=0,l=0,r=0;
     if(in.hasNext())
     t=in.nextInt();
     int primes[]=new int[MAX];
     primes=sieve();
     System.out.println(primes[t]);
        /* for(int j=0;j<t;j++)
         {
             if(in.hasNext())
             l=in.nextInt();
              if(in.hasNext())
             r=in.nextInt();
             System.out.println(segsieve(l,r,primes));
         }*/
    }
}

import java.util.*;

public class Problem26A {

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();

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

        int count = 0;
        for (int i = 0 ; i <= n; i++) {
            if (sieve[i] == 2)
                count += 1;
        }

        System.out.println(count);
    }
}

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;

public class Main {
    static ArrayList<Integer> primes =new ArrayList<>();
    static ArrayList<Integer> almostPrimes =new ArrayList<>();
    public static void main(String[] args) {
	// write your code here
        Scanner in = new Scanner( System.in);
        primeofStieve(9000000);
        for (int i=2;i<=3000;i++)
           if (countAlmostPrimes(i) ==2)
               almostPrimes.add(i);
        while (in.hasNextInt())
        {
            System.out.println(answer(in.nextInt()));
        }
    }

    private static void primeofStieve(int i) {
        boolean [] array = new boolean[i+1];
        Arrays.fill(array,true);
        for (int j = 2;j*j<i;j++)
           if (array[j]) {
               for (int k = j; k <= i; k += j) {
                   array[k] = false;
               }
               primes.add(j);
           }
    }
    static int countAlmostPrimes(int n)
    {

        int count =0;
        for (int  i=0;i<primes.size();i++)
        {
            if (n%primes.get(i)==0)
                count++;
        }
        return count;
    }
    static int answer(int n)
    {
        int i=0;
        int count = 0;
        while (i<almostPrimes.size()&&almostPrimes.get(i)<=n)
        {
         count++;
         i++;
        }
        return count;
    }

}

import java.util.*;
public class A26 {

	public static int a[] = new int[3000];
	public static int la = 0;

	public static boolean isap(int x){
		int cnt = 0;
		for(int i = 0 ; i<la;i++){
			if (x%a[i]==0){
				cnt++;
				while(x%a[i]==0) x=x/a[i];
			}
			if (cnt>2) return false;
			if (a[i]>x) break;
		}
		if (cnt==2) return true;
		return false;

	}

	public static boolean isp(int x){
		boolean flag = true;
		for(int i = 2; i<x/2+1; i++){
			if (x%i==0) return false;
		}
		return true;

	}

	public static void main(String args[]){
		Scanner input = new Scanner(System.in);

		int n = input.nextInt();

		for(int i = 2; i<=n;i++) if (isp(i)){
			a[la]=i;
			la++;
		}

		int cnt = 0;
		for(int i = 6; i<=n;i++){
			if (isap(i)) cnt++;

		}
		//for (int i = 0 ; i<=la;i++)	System.out.print(a[i]+" ");
		System.out.println(cnt);

	}

}

import java.util.*;

public class AlmostPrice {

    public static void main(String[] args) {
        Scanner console = new Scanner(System.in);
        // n = maximum number to test starting from 1
        ArrayList<Integer> temp = new ArrayList<Integer>();
        int n = console.nextInt(), ans = 0;

        for (int i = 2; i <= n; i++) {
            temp = primeFactors(i);
            Set set = new HashSet(temp);
            if (set.size()==2) {
                ans++;
            }
        }
        System.out.println(ans);
    }

    public static ArrayList<Integer> primeFactors(int n) {
        ArrayList<Integer> sol = new ArrayList<Integer>();
        while (n%2==0) {
            sol.add(2);
            n /= 2;
        }

        for (int i = 3; i <= Math.sqrt(n); i += 2) {
            while (n%i == 0) {
                sol.add(i);
                n /= i;
            }
        }

        if (n>2) {
            sol.add(n);
        }
        return sol;

    }
}

import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.InputMismatchException;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author alex
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskA solver = new TaskA();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskA {
    public void solve(int testNumber, InputReader in, PrintWriter out) {
        int n = in.readInt();
        int ans = 0;
        for (int i=1;i<=n;++i)
            ans += almost(i);
        out.println(ans);
    }

    private int almost(int x) {
        int k = 0;
        for (int i = 2; i < x; ++i) {
            if (prime(i) && x%i==0) ++k;
        }
        return k==2 ? 1 : 0;
    }

    private boolean prime(int x) {
        for (int i=2;i*i<=x;++i)
            if (x%i==0) return false;
        return true;
    }
}

class InputReader {

    private InputStream stream;
    private byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;

    public InputReader(InputStream stream) {
        this.stream = stream;
    }

    public int read() {
        if (numChars == -1)
            throw new InputMismatchException();
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (numChars <= 0)
                return -1;
        }
        return buf[curChar++];
    }

    public int readInt() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public static boolean isSpaceChar(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    }

import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Scanner;

public class Main{

	public static void main(String[] args){

		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();

		boolean[] p = new boolean[n + 1];
		p[0] = p[1] = false;
		for(int i = 2 ; i <= n ; ++i) p[i] = isPrime(i);

		int res = 0;
		for(int i = 3 ; i <= n ; ++i) {
			int c = 0;
			for(int k = 2 ; k <= i ; ++k) {
				if(p[k] && i % k == 0) ++c;
			}

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

		System.out.println(res);

	}

	static boolean isPrime(int n) {
		for(int i = 2 ; i < n ; ++i) {
			if(n % i == 0) return false;
		}
		return true;
	}

}

import java.io.*;
import java.util.*;

/**
 *
 * @author Alejandro E. Garces
 */
public class Main{

    static int N = 3001;
   public static void main(String[] args) throws IOException{
         //String file = "test";
        //System.setIn(new FileInputStream(file+".txt"));
        //System.setOut(new PrintStream(new FileOutputStream(file+"O.txt")));
         BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
         BitSet criba = new BitSet();
         int[] primes = new int[N];
         for(int i = 2; i  < N; i++)
             if(!criba.get(i))
                 for(int j = i * 2;  j < N; j+= i)
                 {
                     criba.set(j);
                     primes[j]++;
                 }
         int M = Integer.parseInt(in.readLine());
         int count = 0;
         for(int i = 1; i <= M; i++)
             if(primes[i] == 2)count++;
         System.out.println(count);

         in.close();
         System.exit(0);
     }
}

import java.util.*;

public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();

        System.out.print(myFunc(n));

    }

    static int myFunc(int n) {
        int ans = 0;
        ArrayList<Integer>[] prime = new ArrayList[n+1];
        for(int i = 0; i< n; i++) {
            prime[i]= new ArrayList<>();
        }

        for(int num = 1; num<= n; num++) {
            prime[num] = getPrimes(num);
        }

        for(List<Integer> p: prime){
            HashMap<Integer, Integer> count = new HashMap<>();
            for(int x: p) {
                if(!count.containsKey(x)) {
                    count.put(x, 1);
                }
            }

            if(count.size() == 2) {
                ans++;
            }
        }

        return ans;
    }

    static ArrayList<Integer> getPrimes(int num) {
        ArrayList<Integer> ret = new ArrayList<>();

        while(num %2 == 0) {
           ret.add(2);
            num /= 2;
        }

        for(int i=3; i<= Math.sqrt(num); i+=2) {
            while(num % i == 0) {
                ret.add(i);
                num /= i;
            }
        }

        if(num > 2)
            ret.add(num);

        return ret;
    }
}

import java.io.*;
import java.util.*;

public class Main{
    //-----------MyScanner class for faster input----------------------------------
    public static class MyScanner {
        BufferedReader br;
        StringTokenizer st;

        public MyScanner() throws FileNotFoundException {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine(){
            String str="";
            try {
                str =  br.readLine().toString();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

    }
    //----------------------------------------------------------------------------

    public static void main(String[] args) throws FileNotFoundException {

        MyScanner sc = new MyScanner();   // Use MyScanner class.
                                          // The constructor MyScanner() has no argument
                                          // as opposed to Scanner(System.in)!
         int n = sc.nextInt();
         int[] arr = new int[n+1];
         int[] rem = new int[n+1];
         int count = 0;
         for(int i=0;i<rem.length;i++) rem[i]=i;

         for(int i=2;i<arr.length;i++) {
             for(int j=i+1;j<arr.length;j++) {
                 int t = rem[j];
                 if(t == 0 ) continue;
                 while( t%i == 0) {
                     t = t/i;
                 }
                 if(rem[j]%i == 0) {
                     rem[j] = t;
                     arr[j]++;
                     if(rem[j] == 1 && arr[j] == 2) count++;
                 }
             }
         }
      /*   for(int i=0;i<arr.length;i++) System.out.print(i + " ");
         System.out.println();

         for(int i=0;i<arr.length;i++) System.out.print(arr[i] + " ");
         System.out.println();

         for(int i=0;i<rem.length;i++) System.out.print(rem[i] + " ");*/
         System.out.println(count);

    }
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.StringTokenizer;

import com.sun.javafx.binding.StringFormatter;

public class Main{
	static class MyScanner {
	    BufferedReader br;
	    StringTokenizer st;

	    public MyScanner() {
	       br = new BufferedReader(new InputStreamReader(System.in));
	    }

	    String next() {
	        while (st == null || !st.hasMoreElements()) {
	            try {
	                st = new StringTokenizer(br.readLine());
	            } catch (IOException e) {
	                e.printStackTrace();
	            }
	        }
	        return st.nextToken();
	    }

	    int nextInt() { return Integer.parseInt(next());}

	    long nextLong() {return Long.parseLong(next());}

	    double nextDouble() {return Double.parseDouble(next());}

	    String nextLine(){
	        String str = "";
		  try {
		     str = br.readLine();
		  } catch (IOException e) {
		     e.printStackTrace();
		  }
		  return str;
	    }
	}

		 public static void main(String[] args) throws IOException {
			 	PrintWriter out = new PrintWriter(System.out);
			    MyScanner sc = new MyScanner();
			 	Main solver = new Main();
				solver.solve(out, sc);
				out.flush();
				out.close();

		 }

 		void solve(PrintWriter out, MyScanner sc) throws IOException{
 		//	long s = System.currentTimeMillis();

 				int n = sc.nextInt();
 				int res = 0;
 				for(int i = 1 ; i <= n ; ++i) {
 						int c = 0;
 						int m = i;
 						for(int k = 2 ; k * k <= i ; ++k) {
 							if(m % k == 0) {
 								++c;

 								while(m % k == 0) m /= k;
 							}
 						}
 						if(c == 1 && m > 1) ++res;
 						else if(c == 2 && m == 1) ++res;
 				}

 			out.print(res);

 			//out.print(System.currentTimeMillis() - s);

 		}

}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.BitSet;

public class c26A {

        public static void main(String[] args) {
/*          new Thread(null, new Runnable() {
                public void run() {
                    new test().run();
                }
            }, "1", 1 << 23).start();*/

            new c26A().run();
        }

        public void run() {

            int n = 0;

            try {
                BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
                n = Integer.parseInt(in.readLine());
            }
            catch (IOException e)
            { }

            BitSet set = new BitSet(n);

            for (int i=2;i<n+1;i++)
            {
                boolean t = true;
                for (int j=2;j<i;j++)
                {
                    if (i % j == 0)
                        t = false;
                }

                if (t) set.set(i);
            }

            int total = 0;
            for (int j = 2;j<n+1;j++)
            {
                int temp = 0;
                for (int i = set.nextSetBit(0); i >= 0; i = set.nextSetBit(i+1)) {
                    if (j % i == 0 ) temp++;
                    if (temp > 2) {
                        //System.out.println("a"+j);
                        break;
                    }
                }

                if (temp == 2)
                    {
                        //System.out.println(j);
                        total++;
                    }

            }
            System.out.println(total);
        }
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.math.BigInteger;
import java.util.*;

public class sa {

	public static void main(String[] args) throws IOException {
		// TODO Auto-generated method stub
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int s[]=new int[n+1];
		for(int i=2;i<=n;i++) {
			if(s[i]==0) {
				for(int j=i;j<=n;j+=i)
					s[j]++;
			}
		}
		int ans=0;
		for(int i=6;i<=n;i++) {
			if(s[i]==2)
				ans++;
		}
		System.out.println(ans);

	}

}

import java.util.Arrays;
import java.util.ArrayList;
import java.util.Scanner;
public class A26{
	public static void main(String []args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		boolean[] numbers = new boolean[n+1];
		Arrays.fill(numbers,true);
		int limit = (int) Math.sqrt(n);
		numbers[0] = numbers[1] = false;
		for(int i = 2; i<=limit;i++){
			if(numbers[i]){
				for(int j = i*i;j<=n;j+=i){
					numbers[j]= false;
				}
			}
		}
		ArrayList<Integer> primeList = new ArrayList<>();
		ArrayList<Integer> nonPrimeList = new ArrayList<>();
		for(int i = 1; i<=n; i++){
			if(numbers[i]){
				primeList.add(i);
			}else{
				nonPrimeList.add(i);
			}
		}
		//System.out.println(primeList+" Non :"+nonPrimeList);
		limit = nonPrimeList.size();
		int limit2 = primeList.size(),flag, result = 0;
		for(int i = 2 ; i<limit; i++){
			flag = 0;
			for(int j = 0 ; j<limit2; j++){
				if((nonPrimeList.get(i)%primeList.get(j)) == 0){
					flag++;
				}
				//if(flag==2){ break;}
			}
			if(flag == 2){ result++;}
		}
		System.out.println(result);
	}
}

import java.io.*;
import java.math.*;
import java.util.*;

/**
*
* @author Togrul Gasimov (ttogrul30@gmail.com)
*         Created on 13.09.2013
*/

public class Main {
 public static void main(String[] args) /*throws FileNotFoundException*/ {
     InputStream inputStream = System.in;
     OutputStream outputStream = System.out;
     FastScanner in = new FastScanner(inputStream);
     FastPrinter out = new FastPrinter(outputStream);
     TaskA solver = new TaskA();
     solver.solve(1, in, out);
     out.close();
 }
}

class TaskA{

 public void solve(int testNumber, FastScanner scan, FastPrinter out) /*throws FileNotFoundException*/ {
     //Scanner sscan = new Scanner(new File("input.txt"));
     //PrintStream oout = new PrintStream(new File("output.txt"));
	 int[] d = new int[1000000];
     for(int i = 2; i <= 3000; i++){
    	 if(d[i] == 0)
    	 for(int j = i; j <= 3000; j+= i){
    		 d[j]++;
    	 }
     }
     int ans = 0;
     int n = scan.nextInt();
     for(int i = 1; i <= n; i++){
    	 if(d[i] == 2)ans++;
     }
     out.println(ans);
     //sscan.close();
     //oout.close();
 }
}

class FastScanner extends BufferedReader {
 public FastScanner(InputStream is) {
     super(new InputStreamReader(is));
 }

 public int read() {
     try{
         int ret = super.read();
         return ret;
     }catch(Exception e){
         throw new InputMismatchException();
     }
 }

 public String next() {
     StringBuilder sb = new StringBuilder();
     int c = read();
     while (isWhiteSpace(c)) {
         c = read();
     }
     if (c < 0) {
         return null;
     }
     while (c >= 0 && !isWhiteSpace(c)) {
         sb.appendCodePoint(c);
         c = read();
     }
     return sb.toString();
 }

 static boolean isWhiteSpace(int c) {
     return c >= 0 && c <= 32;
 }

 public int nextInt() {
     int c = read();
     while (isWhiteSpace(c)) {
         c = read();
     }
     int sgn = 1;
     if (c == '-') {
         sgn = -1;
         c = read();
     }
     int ret = 0;
     while (c >= 0 && !isWhiteSpace(c)) {
         if (c < '0' || c > '9') {
             throw new NumberFormatException("digit expected " + (char) c
                     + " found");
         }
         ret = ret * 10 + c - '0';
         c = read();
     }
     return ret * sgn;
 }

 public long nextLong() {
     return Long.parseLong(next());
 }

 public double nextDouble() {
     return Double.parseDouble(next());
 }

 public BigInteger nextBigInteger() {
     return new BigInteger(next());
 }

 public BigDecimal nextBigDecimal(){
     return new BigDecimal(next());
 }

 public String readLine(){
     try{
         return super.readLine();
     }catch(IOException e){
         return null;
     }
 }
}

class FastPrinter extends PrintWriter {

 public FastPrinter(OutputStream out) {
     super(out);
 }
 public FastPrinter(Writer out) {
     super(out);
 }
}

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

import java.util.Scanner;

/**
 *
 * @author IR_HAM
 */
public class AlmostPrime
{
    public static void main(String [] args)
    {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();

        int [] p = new int[3000];
        int m = 0;
        for(int i = 2; i <= 3000; i++)
        {
            boolean prime = true;
            for(int j = 2; j <= Math.sqrt(i); j++)
                if(i % j == 0)
                {
                    prime = false;
                    break;
                }

            if(prime)
            {
                p[m] = i;
                m++;
            }
        }

        int r = 0;
        for(int i = 6; i <= n; i++)
        {
            int k = 0;
            for(int j = 0; j < m; j++)
                if(i % p[j] == 0)
                    k++;
            if(k == 2)
                r++;
        }

        System.out.println(r);
    }
}

import java.util.*;

public class APrime
{
	public boolean isPrime(int n)
	{
		if(n == 2)
			return true;
		if(n < 2 || n % 2 == 0)
			return false;

		int m = (int)Math.sqrt(n) + 1;
		for(int i = 3; i < m; i += 2)
			if(n % i == 0)
				return false;
		return true;
	}

	public boolean isAPrime(int n)
	{
		int c = 0, i;

		for(i = 2; i < n - 1; ++i)
			if(n % i == 0)
				if(isPrime(i))
					++c;
		return c == 2;
	}

	public static void main(String[] args)
	{
		Scanner in = new Scanner(System.in);
		APrime a = new APrime();
		int c = 0, n = in.nextInt();

		for(int i = 1; i <= n; ++i)
			if(a.isAPrime(i))
				c += 1;
		System.out.println(c);
	}
}

import java.util.Scanner;

public class AlmostPrime {
	public static void main(String[] args) {

		Scanner tc = new Scanner(System.in);
		int n = tc.nextInt();
		int count = 0;

		for (int i = 1; i <= n; i++) {
			if (almostPrime(i)) {
				count++;
			}
		}
		System.out.println(n <= 2 ? 0 : count);
	}

	public static boolean almostPrime(int n) {
		int count = 0;
		for (int i = 2; i <= n / 2; i++) {
			if (prime(i) && n % i == 0) {
				count++;
			}
		}
		return count == 2 ? true : false;
	}

	public static boolean prime(int n) {
		for (int i = 2; i <= n / 2; i++) {
			if (n % i == 0) {
				return false;
			}
		}
		return true;
	}
}

import java.util.Scanner;

public class Solution {
    public static void main(String args[]){
        Scanner input = new Scanner(System.in);
        int N = input.nextInt();

        int ans = 0;
        for(int i = 6; i <= N; i++){
            int x = i, cnt = 0;
            for(int j = 2; j <= x; j++){
                if(x % j == 0){
                    cnt++;
                    while(x % j == 0) x /= j;
                }
            }
            if(cnt == 2) ans++;
        }

        System.out.println(ans);
        input.close();
    }
}

import java.util.*;
public class prime{
    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int arr[] = new int[3001];
        int count = 0;
        for(int i=2;i<=n;i++)
        {
            for(int j=2;j<i;j++)
            {
                if(arr[j] == 0 && i%j == 0)
                {
                    arr[i]++;
                }
            }
            if(arr[i]==2)
            {
                count++;
            }
        }
        System.out.print(count);

    }
}

import java.io.*;
import java.util.*;

public class Main {
	public static void main(String[] args) {
		FastScanner fs = new FastScanner();
		PrintWriter out = new PrintWriter(System.out);
		//int t = fs.nextInt();
		for (int k = 1; k <= 1; k++) {
			// int m = fs.nextInt();
			int n = fs.nextInt();
			// long k = fs.nextLong();
			// Long arr[] = fs.readLongArray(n);
			//Prime_Seive ps = new Prime_Seive();
			int result = 0;
			for (int a = 4; a <= n; a++) {
				int arr[] = new int[a + 1];
				prime_seive(a, arr);
				int count = 0;

				for (int i = 1; i <= a; i++) {
					// out.println(i+" "+arr[i]);
					if (arr[i] == 1 && a % i == 0) {
						 //out.print(count+" "+i+" "+a+" ; ");
						count++;
					}
				}
				if (count == 2) {
					result++;
				}
			}
			out.println(result);

			// out.println();

		}

		out.close();
	}

	public static Long solver(Long arr[], int n) {
		Long min = Long.MAX_VALUE;
		Long working = arr[0];
		Long operations = 0L;
		boolean dec = false;
		Long max = Long.MIN_VALUE;
		for (int i = 0; i < n; i++) {
			max = Math.max(max, arr[i]);
			if (arr[i] < max) {
				// System.out.println("max "+max+" "+arr[i]);
				dec = true;
			}
		}
		for (int i = 1; i <= n; i++) {
			if (i < n - 1 && arr[i] <= arr[i + 1] && !dec) {

				// System.out.println(arr[i]+" "+arr[i+1]);
				continue;
			}
			if (i < n - 1 && arr[i] <= arr[i + 1]) {
				working = arr[i + 1];
			}
			Long h = (i == n) ? Long.MAX_VALUE : arr[i];

			min = Math.min(min, h);
			if (h >= working && h != Long.MAX_VALUE) {
				System.out.println(working + " " + min + " " + operations);
				operations += working - min;
				System.out.println(operations);
				working = h;
				min = Long.MAX_VALUE;

			}
		}

		/*
		 * Stack<Long> stack=new Stack<>(); stack.push(arr[0]); Long operations=0L;
		 * boolean dec=false; for(int i=1;i<=n;i++){
		 * if(!stack.isEmpty()&&i<n&&arr[i]<stack.peek()){ dec=true; } Long
		 * h=(i==n)?Long.MAX_VALUE:arr[i]; while(stack.size()>1&&dec&&stack.peek()<h){
		 * operations++; Long element=stack.pop(); element++;
		 * if(element!=stack.peek()&&element!=h){ stack.push(element); } }
		 * if(stack.peek()>h){ stack.push(h); } else
		 * if(stack.peek()<h&&h!=Long.MAX_VALUE){ stack.pop(); stack.push(h); } }
		 */
		return operations;
	}
	public static void prime_seive(int n, int[] arr) {
        int limit=(int)Math.sqrt(n);
        Arrays.fill(arr,1);
        for (int i = 2; i <= limit; i ++) {
            if (arr[i] == 1) {
                //primes.add(i);
                for (int j = i * i; j <= n; j += i) {
                    arr[j] = 0;
                }
            }
        }

        arr[1] = arr[0]=0;

    }

	public static int gcd(int a, int b) {
		if (a == 0)
			return b;

		return gcd(b % a, a);
	}

	static int gcdCoeff(int a, int b, int arr[])// euclidean gcd + extended euclidean
	{
		if (b == 0)
			return a;
		int tmp[] = { 1, 1 };// must be 1,1, because at base step b=0, a=anything, 1.0+ 1.a=a
		int result = gcdCoeff(b, a % b, tmp);
		arr[0] = tmp[1];// x=y1
		arr[1] = (tmp[0] - (a / b) * tmp[1]);// y=(x1-(a/b)*y1)
		return result;
	}

	static class PairIndex {
		long val;
		long index;

		public PairIndex(long val, long index) {
			this.val = val;
			this.index = index;
		}

	}

	static class FastScanner {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer("");

		String next() {
			while (!st.hasMoreTokens())
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());
		}

		int[] readIntArray(int n) {
			int[] a = new int[n];
			for (int i = 0; i < n; i++)
				a[i] = nextInt();
			return a;
		}

		Long[] readLongArray(int n) {
			Long[] a = new Long[n];
			for (int i = 0; i < n; i++)
				a[i] = nextLong();
			return a;
		}

		long nextLong() {
			return Long.parseLong(next());
		}
	}
}

import java.util.Scanner;

public class Main {

	public static void main(String[] args)
	{
		Scanner input = new Scanner(System.in);

		int [] arr = new int [3001];
		int [] counter = new int [3001];
		Sieve(arr,counter);

		int n = input.nextInt();

		int count=0;
		for(int i=0; i <= n; i++)
		{
			if(counter[i] == 2)
				count++;
		}

		System.out.println(count);

	}

	private static void Sieve(int[] arr, int[] counter)
	{
		arr[0] = 1; arr[1] = 1; //not primes
		for(int i=2; i < arr.length; i++)
		{
			if(arr[i] == 0) //prime
			{
				for(int j= i+i; j < arr.length; j+=i)
				{
					arr[j] = 1; //not prime
					counter[j]++;
				}
			}
		}

	}

}

import java.io.*;
import java.util.*;

public class almostPrime {
	public static void main(String[] args){
		Scanner r = new Scanner(System.in);
		int n = r.nextInt();
		int[] primes = new int[3000];
		int c = 0;
		for(int i=2; i<=3000; i++){
			boolean prime = true;
			for(int j=2; j<=i-1; j++){
				if(i%j==0){
					prime = false;
				}

			}
			if (prime){
				primes[c]=i;

				c++;
			}
		}

		int fc =0;

		for (int i=1; i<=n; i++){
			int cc = 0;
			int[] divisors = new int[10000];

			for(int k=1; k<=i; k++){
				if(i%k==0){
					divisors[cc]=k;
					//System.out.println(k);

					cc++;
				}
			}
			//System.out.println("next");

			int count =0;
			for(int m=0; m<cc; m++){
				for(int j=0; j<c; j++){
					if (divisors[m] != 0 && primes[j] != 0){
					if(divisors[m] == primes[j]){
						count++;
						//System.out.println("count: " +count);

					}
					}
				}
			}
			if (count == 2){
				fc++;
				//System.out.println("Final Count: "+fc);

			}
		}
		System.out.println(fc);
	}
}

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Scanner;
import java.util.Set;

public class A {
	public static void main(String[] args) throws Exception {
		List<Set<Integer>> list = new ArrayList<Set<Integer>>();
		int n = new Scanner(System.in).nextInt();
		int c = 0;
		for(int i = 1; i <= n; ++i){
			Set<Integer> divs = new HashSet<Integer>();
			for(int d : propdiv(i)){
				Set<Integer> dl = list.get(d-1);
				if(dl.size()>0){
					divs.addAll(dl);
				}else{
					divs.add(d);
				}
			}
			list.add(divs);
			if(divs.size()==2){
				++c;
			}
		}
		System.out.println(c);

	}

	static Set<Integer> propdiv(int n) {
		Set<Integer> set = new HashSet<Integer>();
		for (int i = 2, j = n; i < j; i++) {
			if (n % i == 0) {
				set.add(i);
				set.add(j = n / i);
			}
		}
		return set;
	}
}

import java.util.*;
public class Main {

    static boolean [] b ;
    static int n ;
    static List<Integer> list = new ArrayList();

    public static void main(String[] args)  {
      //Scanner input= new Scanner (new File("input.txt"));

        Scanner input = new Scanner (System.in);
       n =input.nextInt();
        b= new boolean [n+1];
        seive ();
        int count1 =0 , count2 =0 ;
        boolean flag= true  ;

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

            for (int a : list) {
                if (a>=i) break ;
                if(i%a==0)
                {count1++;

                if (count1 > 2){ flag = false ; break;}
                }
            }
            if(flag){if(count1==2) count2++;}
            count1=0; flag=true;
        }
        System.out.println(count2);

    }
    public static void seive (){
        for (int i = 0; i <= n; i++) {
            b[i]= true ;
        }
        b[0]=b[1]=false;
        for (int i = 2; i*i <= n ; i++) {
            if (b[i]){
                for (int j =i+i; j <=n; j+=i) {
                    b[j]=false ;
                }

        }
        }

        for (int i = 2; i < n; i++) {
            if (b[i])
              list.add(i);
        }
    }

}

import java.util.Scanner;

public class pri {
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int p=sc.nextInt(),l=0,g=0;
		for (int n=2;n<=p;n++)
		{l=0;
		for(int i=2;i<=n;i++)
		{if(n%i==0)
		{
			int u=0;
			for(int h=i/2;h>=2;h--)
			{
				if(i%h==0)
				{
					u=1;
					break;
				}
			}

			if(u==0 )
			{
				l++;
				if(l>2)
				{
					break;
				}
			}

		}
		}
		if(l==2)
		{
			g++;
		}
		}
			System.out.println(g);

	}

}

//Written by Shagoto
import java.util.Scanner;
//import java.math.RoundingMode;
//import com.google.common.math.IntMath;
public class Main
{
  public static void main(String[]args)
  {
    Scanner read = new Scanner(System.in);

    int n = read.nextInt();
    int count = 0;

    if(n < 6)
    {
      System.out.println(0);
    }
    else
    {
      for(int x = 6; x<=n; x++)
      {
        int primeCount = 0;
        for(int i = 2; i<=x; i++)
        {
          int temp = 0;
          for(int j = 1; j<=(int)Math.sqrt(i); j++)
          {
            if(i % j == 0)
            {
              temp++;
            }
          }

          if(temp == 1)
          {
            if(x % i == 0)
            {
              primeCount++;
              if(primeCount > 2)
              {
                break;
              }
            }
          }
        }

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

      System.out.println(count);
    }
  }
}

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Scanner;
import java.util.Set;

public class A {
	public static void main(String[] args) throws Exception {
		s = new int[20];
		for (int i = 0, e = 2; i < s.length; i++) {
			for (; !isPrime(e); e++)
				;
			s[i] = e++;
		}
		List<Set<Integer>> list = new ArrayList<Set<Integer>>();
		int n = new Scanner(System.in).nextInt();
		int c = 0;
		for(int i = 1; i <= n; ++i){
			Set<Integer> divs = new HashSet<Integer>();
			for(int d : propdiv(i)){
				Set<Integer> dl = list.get(d-1);
				if(dl.size()>0){
					divs.addAll(dl);
				}else{
					divs.add(d);
				}
			}
			list.add(divs);
			if(divs.size()==2){
				++c;
			}
		}
		System.out.println(c);

	}

	static Set<Integer> propdiv(int n) {
		Set<Integer> set = new HashSet<Integer>();
		for (int i = 2, j = n; i < j; i++) {
			if (n % i == 0) {
				set.add(i);
				set.add(j = n / i);
			}
		}
		return set;
	}

	static int[] s;

	static boolean isPrime(int n) {
		for (int e : s)
			if (e > 0 && n != e && n % e < 1)
				return false;
		return true;
	}
}

import java.util.Scanner;

public class P1 {
	private static final Scanner IN = new Scanner(System.in);
	private static final int TOT = 3000;
	private static final boolean primos[] = new boolean[TOT+1];

	private static final void fillCriba(){
		primos[0]=true;
		primos[1]=true;
		int tope = (int)Math.sqrt(TOT)+1;
		for (int i = 2; i <= tope; i++) {
			if(isPrimo(i)){
				if((i*i)>=TOT) return;
				for (int j = i; j <= (TOT/2)+1; j++) {
					if (j*i > TOT) break;
					primos[j*i]=true;
				}
			}
		}
	}

	public static void main(String[] args) {
		fillCriba();
		int c = 0;
		int n = IN.nextInt();
		for (int i = 6; i <= n; i++) {
			if(isAlmost(i)) c++;
		}
		System.out.println(c);
	}

	private static boolean isAlmost(int n){
		int c = 0;
		for (int i = 2; i < n; i++) {
			if (c>2) return false;
			if(n%i==0)
				if(isPrimo(i)) c++;
		}
		return c==2;
	}

	private static boolean isPrimo(int n){
		return !primos[n];
	}
}

import java.io.*;
import java.util.*;
import java.math.*;
import java.lang.*;

import static java.lang.Math.*;

public class Main implements Runnable {
    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private SpaceCharFilter filter;
        private BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars==-1)
                throw new InputMismatchException();

            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                }
                catch (IOException e) {
                    throw new InputMismatchException();
                }

                if(numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            }
            catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
        public int nextInt() {
            int c = read();

            while(isSpaceChar(c))
                c = read();

            int sgn = 1;

            if (c == '-') {
                sgn = -1;
                c = read();
            }

            int res = 0;
            do {
                if(c<'0'||c>'9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            }
            while (!isSpaceChar(c));

            return res * sgn;
        }

        public long nextLong() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            long res = 0;

            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            }
            while (!isSpaceChar(c));
                return res * sgn;
        }

        public double nextDouble() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            double res = 0;
            while (!isSpaceChar(c) && c != '.') {
                if (c == 'e' || c == 'E')
                    return res * Math.pow(10, nextInt());
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            }
            if (c == '.') {
                c = read();
                double m = 1;
                while (!isSpaceChar(c)) {
                    if (c == 'e' || c == 'E')
                        return res * Math.pow(10, nextInt());
                    if (c < '0' || c > '9')
                        throw new InputMismatchException();
                    m /= 10;
                    res += (c - '0') * m;
                    c = read();
                }
            }
            return res * sgn;
        }

        public String readString() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            }
            while (!isSpaceChar(c));

            return res.toString();
        }

        public boolean isSpaceChar(int c) {
            if (filter != null)
                return filter.isSpaceChar(c);
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public String next() {
            return readString();
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);
        }
    }
    public static void main(String args[]) throws Exception {
        new Thread(null, new Main(),"Main",1<<26).start();
    }

    static void merge(int arr[], int l, int m, int r) {
        int n1 = m - l + 1;
        int n2 = r - m;
        int L[] = new int [n1];
        int R[] = new int [n2];
        for (int i=0; i<n1; ++i)
            L[i] = arr[l + i];
        for (int j=0; j<n2; ++j)
            R[j] = arr[m + 1+ j];
        int i = 0, j = 0;
        int k = l;
        while (i < n1 && j < n2){
            if (L[i] <= R[j]){
                arr[k] = L[i];
                i++;
            }
            else{
                arr[k] = R[j];
                j++;
            }
            k++;
        }
        while (i < n1){
            arr[k] = L[i];
            i++;
            k++;
        }
        while (j < n2)
        {
            arr[k] = R[j];
            j++;
            k++;
        }
    }
    static void sort(int arr[], int l, int r) {
        if (l < r)
        {
            int m = (l+r)/2;
            sort(arr, l, m);
            sort(arr , m+1, r);
            merge(arr, l, m, r);
        }
    }

    static void mergel(long arr[], int l, int m, int r) {
        int n1 = m - l + 1;
        int n2 = r - m;
        long L[] = new long [n1];
        long R[] = new long [n2];
        for (int i=0; i<n1; ++i)
            L[i] = arr[l + i];
        for (int j=0; j<n2; ++j)
            R[j] = arr[m + 1+ j];
        int i = 0, j = 0;
        int k = l;
        while (i < n1 && j < n2){
            if (L[i] <= R[j]){
                arr[k] = L[i];
                i++;
            }
            else{
                arr[k] = R[j];
                j++;
            }
            k++;
        }
        while (i < n1){
            arr[k] = L[i];
            i++;
            k++;
        }
        while (j < n2)
        {
            arr[k] = R[j];
            j++;
            k++;
        }
    }
    static void sortl(long arr[], int l, int r) {
        if (l < r)
        {
            int m = (l+r)/2;
            sortl(arr, l, m);
            sortl(arr , m+1, r);
            mergel(arr, l, m, r);
        }
    }

    public void run() {
        InputReader in = new InputReader(System.in);
        PrintWriter out = new PrintWriter(System.out);

        int arr[]=new int[3001];
        Arrays.fill(arr,0);

        for(int i=2;i<3001;i++){
            if(arr[i]==0)
                for(int j=i*2;j<3001;j+=i)
                    arr[j]++;
        }

        int n=in.nextInt();
        int cnt=0;
        for(int i=6;i<=n;i++){
            if(arr[i]==2){
                cnt++;
            }
        }
        out.println(cnt);

        out.close();
    }
}

import java.io.*;
import java.util.*;
public class j
{
public static void main(String aa[])throws IOException
{
BufferedReader b=new BufferedReader(new InputStreamReader(System.in));
int v=0,i=0,n=0,j=0,k=0;
String s;
n=Integer.parseInt(b.readLine());
boolean p[]=new boolean[3001];
Arrays.fill(p,true);
p[0]=false;
p[1]=false;
p[2]=true;
p[3]=true;
p[4]=false;
p[5]=true;
p[6]=false;
p[7]=true;
for(i=8;i<3001;i++)
if(i%2==0||i%3==0||i%5==0||i%7==0)
p[i]=false;
for(i=0;i<3001;i++)
{
if(p[i])
{
for(j=2;j<=(int)Math.sqrt(i);j++)
{
if(i%j==0)
{
p[i]=false;
break;
}
}
}
}
for(j=0;j<=n;j++)
{
for(i=0;i<3001;i++)
{
if(p[i]==true&&(j%i)==0)
{
v++;
}
}
if(v==2)
k++;
v=0;
}
System.out.print(k);
}
}

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.lang.reflect.Array;
import java.math.BigInteger;
import java.net.InetAddress;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Scanner;
import java.util.StringTokenizer;
import javax.swing.tree.TreeNode;

public class codeforces {

    public static int Binary(int x,int array[]){
        int min=0;
        int max=array.length-1;
        int mid=0;
        while(min<max){
            mid=(max+min)/2;
            if (array[mid]==x)return mid;
            if (x>array[mid])min=mid+1;
            if (x<array[mid])max=mid-1;

        }

    return 0;}

    public static void main(String[] args) throws IOException {
        Reader.init(System.in);
        PrintWriter pw=new PrintWriter(System.out);
        StringBuilder sb=new StringBuilder("");
        int n=Reader.nextInt();
        int array[]=new int[3001];
        for (int i = 0; i < 3001; i++) {
            boolean prime=true;
            for (int j = 2; j < i; j++)
                if(i%j==0)prime=false;
            if(prime)array[i]++;
        }

        int count=0;
        for (int i = 6; i <= n; i++) {
            int count2=0;
            for (int j = 2; j < i; j++) {
                if(array[j]>=1 && i%j==0 )count2++;
            }
            if(count2==2)count++;
        }

          pw.println(count);

        pw.close();

    }

    }

 class Reader {

        static BufferedReader reader;
        static StringTokenizer tokenizer;

        public static int pars(String x) {
            int num = 0;
            int i = 0;
            if (x.charAt(0) == '-') {
                i = 1;
            }
            for (; i < x.length(); i++) {
                num = num * 10 + (x.charAt(i) - '0');
            }

            if (x.charAt(0) == '-') {
                return -num;
            }

            return num;
        }

        static void init(InputStream input) {
            reader = new BufferedReader(
                    new InputStreamReader(input));
            tokenizer = new StringTokenizer("");
        }

        static void init(FileReader input) {
            reader = new BufferedReader(input);
            tokenizer = new StringTokenizer("");
        }

        static String next() throws IOException {
            while (!tokenizer.hasMoreTokens()) {
                tokenizer = new StringTokenizer(
                        reader.readLine());
            }
            return tokenizer.nextToken();
        }

        static int nextInt() throws IOException {
            return pars(next());
        }

        static long nextLong() throws IOException {
            return Long.parseLong(next());
        }

        static double nextDouble() throws IOException {
            return Double.parseDouble(next());
        }
    }

import java.io.*;
public class prime
{
public static void main(String args[])throws IOException
{
BufferedReader obj=new BufferedReader(new InputStreamReader(System.in));
int n,i,j,count=0,sum=0;
n=Integer.parseInt(obj.readLine());
boolean a[]=new boolean[n+1];
for(i=0;i<=n;i++)a[i]=true;
for(i=2;i<=n;i++)
{
if(a[i]==false)continue;
else {for(j=i+i;j<=n;j+=i)a[j]=false;}
}
for(j=6;j<=n;j++){
for(i=2;i<=j;i++)
if(a[i]==true){if(j%i==0)count++;}
if(count==2)sum++;
count=0;}
System.out.println(sum);
}
}

import java.util.*;
public class Main{
     public static void main(String ... S){
          Scanner sc = new Scanner(System.in);
          int n = sc.nextInt();
          boolean primes[] = new boolean[10000];
          for(int i = 0; i<10000; i++){
               primes[i] = true;
          }
          primes[2] = true;
          primes[3] = true;
          for(int i = 2; i*i < n ; i++){
               if(primes[i] == true)
                for(int j = i*i; j<=n; j+=i)
                 primes[j] = false;
          }
          int ans = 0;
        for(int i = 6; i<=n ; i++){
           int count = 0;
           for(int j=2; j<=n;j++){
                if(primes[j] == true)
                 if(i % j == 0)
                  count++;
           }
           if(count == 2) ans++;
        }
        System.out.println(ans);
     }
}

import java.util.Scanner;

public class AlmostPrime {

    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n = sc.nextInt();
        int count=0;
        for (int i=4; i<=n; i++){
            if (almostPrime(i))
                count++;
        }
        System.out.println(count);

    }

    private static boolean almostPrime(int n) {
        boolean primes []=new boolean [n+2];
        for (int i=2; i*i<n+2; i++){
            for (int j=2; i*j<n+2; j++){
                primes[i*j]=true;
            }
        }
        int count=0;
        for (int i=2; i<n; i++){
            if (!primes[i] && n%i==0)
                count++;

        }

        if (count==2)
            return true;
        return false;

    }

}

import java.util.*;
public class AlmostPrime_26A {

    public static Scanner in = new Scanner(System.in);
    public static List<Integer> primes;
    public static int c = 0; //c is the size of primes

    public static void generatePrimes(int n) { //using sieve
        //0 is prime, 1 isnt
        primes = new ArrayList<Integer>();
        int [] sieve = new int [n+1];
        int i = 2;
        while (i < n) {
            if (sieve[i] == 0)
                for (int j = i+i; j <= n; j=j+i)
                    sieve[j] = 1;
            i++;
        }
        for(int k = 2; k< sieve.length; k++)
            if (sieve[k] == 0)
                primes.add(k);
    }
    public static int almostPrimes(int n) {
        //doing exculsion--simpler?
        int [] s = new int[n+1];
        for (int i = 0; i<primes.size(); i++)
            for (int j = 2; j<n+1; j++)
                if (j%primes.get(i) == 0)
                    s[j]++;
        int p = 0;
        for (int j = 0; j<n+1; j++)
            if (s[j] == 2)
                p++;
        /*
        for (int i =0; i< primes.size() && primes.get(i) != 0 && primes.get(i)*2 <= n; i++){
            for (int k=2; Math.pow(primes.get(i), k) <= n; k++)
                p++;    //ex 2*2 = 4
        }
        p++; //for 1*1
        System.out.println(p +" " + c);
        return p+c;  */
        return p;
    }
    public static void main (String[] args) {
        int n = in.nextInt();
        generatePrimes(n);
        System.out.println(almostPrimes(n));
    }
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class AlmostPrime {

	public static void main (String args[]) throws NumberFormatException, IOException{

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int N = Integer.parseInt(br.readLine());
		boolean[] isPrime = new boolean[N+1];
		for (int i = 2; i <= N; i++) {
			isPrime[i] = true;
		}
		for (int i = 2; i <= N; i++){
			if (isPrime[i]){
				for (int j = i; i*j <= N; j++){
					isPrime[i*j] = false;
				}
			}
		}

		int count = 0;
		for (int i = 2; i <= N; i++){
			if (!isPrime[i]){ continue; }
			for (int j = i+1; j<=N; j++){
				if (!isPrime[j]){ continue; }
				int n1 = i, n2 = j;
				while (n1 <= N){
					while (n1*n2 <= N){
						count++;
						n2 *= j;
					}
					n1 *= i;
					n2 = j;
				}
			}
		}
		System.out.println(count);

	}
}

import java.util.*;

public class Trying
{
    public static void main (String[] args)
    {
        Scanner enter = new Scanner(System.in);
        int n = enter.nextInt(), number = 0, divisors = 0;
        for(int i = 2 ; i <= n ; i++)
        {
            divisors = 0;
            for(int j = 2 ; j <= i/2 ; j++)
            {
                if(i % j == 0 && prime(j) == 1) divisors++;
            }
            if(divisors == 2) {number++;}
        }
        System.out.println(number);
    }
    public static int prime(int n)
    {
        for(int i = 2 ; i <= n/2 ; i++)
        {
            if(n % i == 0) return 0;
        }
        return 1;
    }
}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.BufferedWriter;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;
/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author o_panda_o(emailofpanda@yahoo.com)
 */
public class Code_26A_AlmostPrime{
    public static void main(String[] args){
        InputStream inputStream=System.in;
        OutputStream outputStream=System.out;
        InputReader in=new InputReader(inputStream);
        OutputWriter out=new OutputWriter(outputStream);
        _26A_ solver=new _26A_();
        solver.solve(1,in,out);
        out.close();
    }
    static class _26A_{
        public void solve(int testNumber,InputReader in,OutputWriter out){
            int n=in.nextInt(), total=0;
            for(int i=6;i<=n;++i){
                int counter=i, totalDivisors=0;
                if(counter%2==0){
                    while(counter%2==0) counter/=2;
                    ++totalDivisors;
                }
                for(int j=3;j<=i;j+=2){
                    if(counter%j==0){
                        ++totalDivisors;
                        while(counter%j==0) counter/=j;
                    }
                }
                if(totalDivisors==2) ++total;
            }
            out.print(total);
        }
    }
    static class InputReader{
        private InputStream stream;
        private byte[] buf=new byte[1024];
        private int curChar;
        private int numChars;
        private InputReader.SpaceCharFilter filter;
        public InputReader(InputStream stream){
            this.stream=stream;
        }
        public int read(){
            if(numChars==-1){
                throw new InputMismatchException();
            }
            if(curChar>=numChars){
                curChar=0;
                try{
                    numChars=stream.read(buf);
                }catch(IOException e){
                    throw new InputMismatchException();
                }
                if(numChars<=0){
                    return -1;
                }
            }
            return buf[curChar++];
        }
        public int nextInt(){
            int c=read();
            while(isSpaceChar(c)){
                c=read();
            }
            int sgn=1;
            if(c=='-'){
                sgn=-1;
                c=read();
            }
            int res=0;
            do{
                if(c<'0' || c>'9'){
                    throw new InputMismatchException();
                }
                res*=10;
                res+=c-'0';
                c=read();
            }while(!isSpaceChar(c));
            return res*sgn;
        }
        public boolean isSpaceChar(int c){
            if(filter!=null){
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }
        public static boolean isWhitespace(int c){
            return c==' ' || c=='\n' || c=='\r' || c=='\t' || c==-1;
        }
        public interface SpaceCharFilter{
            public boolean isSpaceChar(int ch);
        }
    }
    static class OutputWriter{
        private final PrintWriter writer;
        public OutputWriter(OutputStream outputStream){
            writer=new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }
        public OutputWriter(Writer writer){
            this.writer=new PrintWriter(writer);
        }
        public void close(){
            writer.close();
        }
        public void print(int i){
            writer.print(i);
        }
    }
}

import java.util.*;
import java.lang.*;
import java.io.*;

public class ProblemA
{
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner sc=new Scanner (System.in);
		int n=sc.nextInt();
		if(n<6){
		    System.out.println(0);
		    System.exit(0);
		}
		int arr[]=new int[n+1];
		arr[2]=1;
		for(int i=3;i<=n;i+=2){
		    arr[i]=1;
		}
		for(int i=3;i*i<=n;i++){
		    if(arr[i]==1){
		        for(int j=i*i;j<=n;j+=i){
		            arr[j]=0;
		        }
		    }
		}
		ArrayList<Integer> prime=new ArrayList<Integer>();
		for(int i=0;i<=n;i++){
		    if(arr[i]==1){
		        prime.add(i);
		    }
		}
		Arrays.fill(arr,0);
		ArrayList<Integer>ans=new ArrayList<Integer>();
		for(int i=6;i<=n;i++){
		    int count=0;
		    for(int j=0;j<prime.size()&&prime.get(j)<n;j++){
		        if(i%prime.get(j)==0){
		            count+=1;
		        }
		        if(count>2){
		            break;
		        }
		    }
		    if(count==2){
		        ans.add(i);
		    }
		}
		System.out.println(ans.size());
		}
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class AlmostPrime {
	public static void main(String[] args) throws IOException{
		BufferedReader lector = new BufferedReader(new InputStreamReader(System.in)); //lectura de la entrada
		String linea = lector.readLine(); //string de la entrada
		int n = Integer.parseInt(linea); //entero de la entrada (si lo necesitas).

		if(n <6){
			System.out.println(0);
		}else{

			/*Variables */

			boolean[] noCasiPrimo = new boolean[n];
			noCasiPrimo[0] = true;
			noCasiPrimo[1] = true;
			noCasiPrimo[2] = true;

			int tope = (int) n/2 +1;
			boolean[] noPrimos = new boolean[n];
			noPrimos[0] = true;
			noPrimos[1] = false;
			noPrimos[2] = false;

			/*Criba */
			for(int k=2; k<n; k++){
				if(!noPrimos[(k-1)]){
					for(int j=k*2; j<=n; j=j+k){
						noPrimos[(j-1)] = true;
					}
				}
			}

//			//Mostrar primos
//			for(int k=1; k<=n; k++){
//				if(!noPrimos[(k-1)]){
//					System.out.print(k + " ");
//				}
//			}

			/*Casi Primos */
			for(int j=1; j<=n; j++){
				int contador = 0;
				int tope2 = (int) j/2 +1;
				//Encontrar factores primos
				for(int k = 2; k<=tope2; k++){
					if(!noPrimos[(k-1)] && (j%k == 0)){
						contador++;
					}
					if(contador>=3){
						break;
					}
				}
				if(contador>=3){
					for(int l=j; l<=n; l=l+j){
						noCasiPrimo[(l-1)] = true;
					}
				}else if(contador == 1){
					for(int l = j; l<=n; l = l*l){
						noCasiPrimo[(l-1)] = true;
					}
				}else if(contador == 2){
					noCasiPrimo[(j-1)] = false;
				}else if(contador == 0){
					noCasiPrimo[(j-1)] = true;
				}
			}

			//Contar casi primos

			int cantidad = 0;
			for(int k=0; k<n; k++){
				if(!noCasiPrimo[k]){
					cantidad++;
				}
			}
			System.out.println(cantidad);
		}
	}

}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {

    public static void main(String[] args) throws IOException {
     int N = 100000;
     boolean prime[]=new boolean[N+1];
        for (int i = 0; i <= N; i++) {

            prime[i]=true;

            if(i%2==0){
                prime[i]=false;
            }
        }
        prime[0]=prime[1]=false;
        prime[2]=true;

        for (int i = 3; i*i <=N; i+=2) {
            if(prime[i]==false)
            {
                continue;
            }

            for(int j = i*i; j <=N; j+=i+i) {
                prime[j]=false;

            }

            }

        //start of the new things
       BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
       StringTokenizer st = new StringTokenizer(br.readLine());
       int n = Integer.parseInt(st.nextToken());

        int sum= 0 ;
        int totalSum=0;
        for (int i = 4; i <= n ; i++) {
            for (int j = 2; j <=i; j++) {
                if(prime[j]){
                    if(i%j==0)
                    {
                        sum++;
                    }
            }

        }
         if(sum==2)
        {

            totalSum++;
        }
          sum=0;

        }

        System.out.println(totalSum);

    }}

import java.util.Scanner;
public class task26a
{
	static int  mass[];
	static int counter = 0;
	public static void start()
	{
		mass[counter++] = 2;
		mass[counter++] = 3;
		for(int i = 2; i < 3000+1; i++)
		{
			boolean status = true;
			for(int j = 2; j < Math.sqrt(i)+2; j++)
				if(i%j == 0)
					status = false;
			if(status)
				mass[counter++] = i;
		}
	}
	public static void main(String[] args)
	{
		Scanner sc = new Scanner(System.in);
		int number = sc.nextInt();
		mass = new int[1000];
		start();

		int answer = 0;
		for(int i = 2; i <= number; i++)
		{
			int start = 0;
			int step = 0;
			int some = i;
			block : while(start < counter)
			{
				if(some % mass[start] == 0)
					step++;

				start++;

			}
			if(step == 2)
				answer++;
		}

		System.out.println(answer);
	}
}

import java.lang.System;
import java.util.*;

public class Solution {
    public static void main(String[] args){
        final Scanner in = new Scanner(System.in);
        final int max = in.nextInt();
        final int n = max + 1;
        final List<Integer> primes = new ArrayList<Integer>();
        final boolean[] array = new boolean[n];
        for(int i = 2; i < n; i++){
            if(array[i]) continue;
            primes.add(i);
            for(int j = i; j < n; j+=i){
                array[j] = true;
            }
        }

        final Set<Integer> result = new HashSet<Integer>();
        for(Integer i : primes){
            for(Integer j : primes) {
                if(i != j){
                    result.addAll(getCombinations(i, j, max));
                }
            }
        }
        System.out.println(result.size());
    }

    public static Collection<Integer> getCombinations(int a, int b, int max){
        final Set<Integer> result = new HashSet<Integer>();
        for(int i = 1; Math.pow(a, i) < max; ++i){
            for(int j = 1; Math.pow(b, j) < max; ++j){
                double tmp = Math.pow(a, i) * Math.pow(b, j);
                if(tmp <= max) {
                    result.add((int)tmp);
                }
            }
        }
        return result;
    }
}

import java.util.*;
import java.lang.*;
import java.io.*;
public class Almost_prime {

	public static void main(String[] args) throws java.lang.Exception
	{
	    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	    int n=Integer.parseInt(br.readLine()),count=0;
	    boolean prime[]=new boolean[n+1];
	    for(int i=2; i<=n; ++i) prime[i]=true;
	    for(int i=2; i*i<=n; ++i) {//2 is the smallest prime
	    	if(prime[i]) {
	    		for(int j=i*i; j<=n; j+=i) prime[j]=false;
	    	}
	    }
	    for(int i=6; i<=n; ++i) {//6 is the smallest almost prime
	    	int c=0;
	    	for(int j=2; j<=i; ++j) {
	    		if(i%j==0 && prime[j]) ++c;
	    	}
	    	if(c==2) ++count;
	    }
	    System.out.println(count);
	}
}

import java.io.*;
import java.util.StringTokenizer;

public class Q26A implements Runnable {
    private void solve() throws IOException {
        int n = nextInt();
        int[] lp = new int[n + 1];
        for (int i = 2; i <= n; i++) {
            if (lp[i] == 0) {
                for (int j = i + i; j <= n; j += i) {
                    lp[j]++;
                }
            }
        }
        int count = 0;
        for (int i = 4; i <= n; i++) {
            if (lp[i] == 2) count++;
        }
        writer.print(count);
    }

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

    BufferedReader reader;
    StringTokenizer tokenizer;
    PrintWriter writer;

    public void run() {
        try {

            boolean oj = System.getProperty("ONLINE_JUDGE") != null;

            reader = oj ? new BufferedReader(new InputStreamReader(System.in)) :
                    new BufferedReader(new FileReader(new File("input.txt")));

            tokenizer = null;
            writer = new PrintWriter(System.out);
            solve();
            reader.close();
            writer.close();
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(1);
        }
    }

    int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }

    long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }

    double nextDouble() throws IOException {
        return Double.parseDouble(nextToken());
    }

    String nextToken() throws IOException {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            tokenizer = new StringTokenizer(reader.readLine());
        }
        return tokenizer.nextToken();
    }
}

import java.util.*;

public class Main
{
	private final int N = 3000;
	private boolean[] p;

	private void sieve()
	{
		p = new boolean[N + 1];
		Arrays.fill(p, true);
		p[0] = false;
		p[1] = false;
		for(int i = 2; i * i <= N; ++i)
			if(p[i])
				for(int j = i * i; j <= N; j += i)
					p[j] = false;
	}

	private void solve()
	{
		Scanner sc = new Scanner(System.in);

		sieve();

		while(sc.hasNextInt())
		{
			int n = sc.nextInt(), res = 0;
			for(int i = 1; i <= n; ++i)
			{
				int curp = 0;
				for(int j = 1; j * j <= i; ++j)
					if(i % j == 0)
					{
						if(p[j])
							++curp;
						if(i / j != j && p[i / j])
							++curp;
					}
				if(curp == 2)
					++res;
			}
			System.out.println(res);
		}
	}

	public static void main(String[] args)
	{
		new Main().solve();
	}
};

import java.util.*;

public class Main {

    public static void main(String[] args) {

        Scanner kb = new Scanner(System.in);
        int n = kb.nextInt();
        int ans = 0;
        for (int k = 1; k <= n; k++) {
            int count = 0;
            for (int i = 1; i <= k; i++) {
                if (k % i == 0 && isPrime(i))
                    count++;
            }
            if (count == 2)
                ans++;
        }
        System.out.println(ans);

    }

    public static boolean isPrime(int n) {
        if (n == 1)
            return false;
        if (n == 2)
            return true;
        for (int i = 2; i < n; i++) {
            if (n % i == 0)
                return false;
        }
        return true;
    }

}

import java.util.*;
public class lucky_div{
	public static void is_almost(int[] arr , int n)
	{
		for(int i = 2; i <n ;i++)
			if(arr[i] == 0)
				for(int j = 2*i; j<=n ; j+=i)
					arr[j]++;
	}
	public static void main(String[] args) {
		Scanner scn = new Scanner(System.in);
		int n = scn.nextInt();
		int cnt = 0;
		int[] arr = new int[3005];
		is_almost(arr , 3004);
		for(int i=0 ; i <= n ; i++)
			if(arr[i] == 2)
				cnt++;
		System.out.println(cnt);
	}
}

import java.io.*;
import java.util.*;
public class AlmostPrime
{
    public static void main(String[] args) throws IOException
    {
        boolean[] primes = new boolean[1520];
        ArrayList<Integer> list = new ArrayList<Integer>();
        Arrays.fill(primes, true);
        primes[0]=false;primes[1]=false;
        for (int i = 2; i < primes.length; i++)
            if (primes[i]==true){
                list.add(i);
                if(i*1L*i > primes.length) continue;
                for (int j = i*i; j < primes.length; j += i)
                    primes[j]=false;
            }

        Reader in = new Reader();

        int n, count, d1, d2, pow1, pow2, temp;
        boolean done;
        for (int i = 0; i < 1; i++) {
            n = in.nextInt();
            count = 0;
            done = false;
            for (int j = 0; j < list.size() && !done; j++) {
                d1 = list.get(j);
                for (int k = j+1; k < list.size(); k++) {
                   d2 = list.get(k);
                   if(d1*d2 > n) {
                       break;
                   }
                   pow1 = d1;
                    while (pow1 < n) {
                        pow2 = d2;
                        while (true) {
                            temp = pow1*pow2;
                            if(temp > n) break;
                            count++;
                            pow2 *= d2;
                        }
                        pow1 *= d1;
                    }
                }
            }
            System.out.println(count);
        }
    }
    static class  Reader
    {
        BufferedReader br;
        StringTokenizer st;
        Reader() { // To read from the standard input
            br = new BufferedReader(new InputStreamReader(System.in));
        }
        Reader(int i) throws IOException { // To read from a file
            br = new BufferedReader(new FileReader("Sample Input.txt"));
        }
       String next() throws IOException {
          while (st == null || !st.hasMoreTokens())
             st = new StringTokenizer(br.readLine());
          return st.nextToken();
       }
       int nextInt() throws IOException { return Integer.parseInt(next()); }
       long nextLong() throws IOException { return Long.parseLong(next()); }
       double nextDouble() throws IOException { return Double.parseDouble(next()); }
       String nextLine() throws IOException { return br.readLine(); }
    }

}

//package codeforces;

import java.util.*;

/**
 * Created by nitin.s on 01/04/16.
 */
public class AlmostPrime {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        boolean[] primes = new boolean[4000];
        Arrays.fill(primes, true);
        primes[0] = primes[1] = false;
        for(int i = 2; i * i < 4000; ++i) {
            if(primes[i]) {
                for(int j = i + i; j < 4000; j += i) {
                    primes[j] = false;
                }
            }
        }
        Set<Integer> primeDivisor = new HashSet<Integer>();
        int answer = 0;
        for(int num1 = 1; num1 <= n; ++num1) {
            primeDivisor.clear();
            for(int i = 0; i < 4000; ++i) {
                if(primes[i]) {
                    int num = num1;
                    if(num % i == 0) {
                        while(num != 0) {
                            primeDivisor.add(i);
                            num = num / i;
                        }
                    }
                }
            }
            if(primeDivisor.size() == 2) {
                ++answer;
            }
        }
        System.out.println(answer);
    }
}

import java.util.*;

public class Problem26A {

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();

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

        int count = 0;
        for (int i = 0 ; i <= n; i++) {
            if (sieve[i] == 2)
                count += 1;
        }

        System.out.println(count);
    }
}

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Scanner;
import java.util.Set;

public class A {
	public static void main(String[] args) throws Exception {
		List<Set<Integer>> list = new ArrayList<Set<Integer>>();
		int n = new Scanner(System.in).nextInt();
		int c = 0;
		for(int i = 1; i <= n; ++i){
			Set<Integer> divs = new HashSet<Integer>();
			for(int d : propdiv(i)){
				Set<Integer> dl = list.get(d-1);
				if(dl.size()>0){
					divs.addAll(dl);
				}else{
					divs.add(d);
				}
			}
			list.add(divs);
			if(divs.size()==2){
				++c;
			}
		}
		System.out.println(c);

	}

	static Set<Integer> propdiv(int n) {
		Set<Integer> set = new HashSet<Integer>();
		for (int i = 2, j = n; i < j; i++) {
			if (n % i == 0) {
				set.add(i);
				set.add(j = n / i);
			}
		}
		return set;
	}
}

import java.io.BufferedReader;
import java.util.Arrays;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.Map;
import java.util.Queue;
import java.util.Scanner;
import java.util.Stack;

public class Main
{
	public static void main(String[] args)
	{
		Scanner input = new Scanner(System.in);
		int n = input.nextInt();

		int [] b = new int[3001];
		int [] pfactors = new int [3001];

		for(int i=2; i <= n; i++)
		{
			if(b[i] == 0)
			{
				for(int j=i+i; j <=n; j+=i)
				{
					b[j] = 1;
					pfactors[j]++;
				}
			}
		}

		int count=0;
		for(int i=0;i < pfactors.length; i++)
		{
			if(pfactors[i] == 2) count++;
		}
		System.out.println(count);
	}
}

import java.util.*;
import java.io.*;
import java.math.*;
public class cf {
    static PrintWriter pw =new PrintWriter(new BufferedOutputStream(System.out),true);
    public static void main(String args[]) throws Exception {
	MyScanner sc = new MyScanner();
	int n=sc.nextInt(),cnt,ans=0;
	ArrayList<Integer> primes = new ArrayList<>();
	for(int i=2;i<=n;i++)
	    if(isPrime(i))primes.add(i);
	Collections.sort(primes);
	for(int i=2;i<=n;i++){
	    if(primes.contains(i))continue;
	    cnt = 0;
	    for(int x : primes){
		if(i<x)break;
		else if(i%x == 0)cnt++;
	    }
	    if(cnt == 2)ans++;
	}
	pw.println(ans);
	sc.close();
	pw.close();
    }
    private static boolean isPrime(int x){
	int t=(int)Math.sqrt(x);
	for(int i=2;i<=t;i++)if(x%i==0)return false;
	return true;
    }
}
class MyScanner {
    private final BufferedReader br;
    private StringTokenizer st;
    MyScanner() { br = new BufferedReader(new InputStreamReader(System.in)); }
    String next() throws IOException {
	if(st == null || !st.hasMoreElements())
	    st = new StringTokenizer(br.readLine());
	return st.nextToken();
    }
    char nextChar() throws IOException { return next().charAt(0); }
    int nextInt() throws IOException {	return Integer.parseInt(next()); }
    double nextDouble() throws IOException{ return Double.parseDouble(next()); }
    long nextLong() throws IOException { return Long.parseLong(next()); }
    boolean nextBoolean() throws IOException { return next().equals("true"); }
    String nextLine() throws IOException { return br.readLine(); }
    void close() throws IOException { br.close(); }
}

import java.util.*;

public class B_Almost_Prime {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        StringBuilder out = new StringBuilder();
        int n = in.nextInt(),cnt=0;
        for (int i = 1; i <= n; i++) {
            if(divisors(i)==2){
//                System.out.println("div("+i+")= "+ divisors(i));
                 cnt++;
            }
        }
        out.append(cnt + "\n");
        System.out.print(out);
    }
    public static int divisors(int n) {

        Set<Integer> primeFactors = new HashSet<Integer>();

        for (int i = 2; i * i <= n; i++) {
            while (n % i == 0) {
                primeFactors.add(i);
                n /= i;
            }
        }
        if (n > 1) {
            primeFactors.add(n);
        }
        return primeFactors.size();
    }
}

import java.io.*;
import java.util.*;

public class Main {

    boolean fits(int a) {
        final TreeSet<Integer> s = new TreeSet<Integer>();

        while(a != 1) {
            int b = 2;

            while(a % b != 0)
                ++b;

            s.add(b);
            a /= b;
        }

        return s.size() == 2;
    }

    void solve() throws IOException {
        int n = nextInt();
        int ans = 0;

        for(int i = 1; i <= n; ++i)
            if(fits(i))
                ++ans;

        out.println(ans);
    }

    void run() throws IOException {
        in = new BufferedReader(new InputStreamReader(System.in));
        out = System.out;
        solve();
        in.close();
        //out.close();
    }

    BufferedReader in;
    PrintStream out;
    StringTokenizer tok;

    void take() throws IOException {
        tok = new StringTokenizer(in.readLine());
    }

    String nextToken() throws IOException {
        while(tok == null || !tok.hasMoreTokens())
            take();

        return tok.nextToken();
    }

    int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }

    long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }

    double nextDouble() throws IOException {
        return Double.parseDouble(nextToken());
    }

    public static void main(String[] args) throws IOException {
        new Main().run();
    }
}

import java.util.Scanner;
public class Almostprime {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
    int n=sc.nextInt();
    int ans=0;
   for(int k=1;k<=n;k++)
   {
       int p=k;
       int a[]=new int[k/2];
        for(int i=2,j=0;i<=p;i++)
    {
        if(p%i==0)
        {
            a[j]=i;
            j++;
                while(p%i==0)
                 p=p/i;
        }
}
        int count=0;
    for(int i=0;i<k/2;i++)
    {
        if(a[i]!=0)
            count++;
    if(count>2)
    break;
    }
    if(count==2)
    ans++;
    continue;
    }

    System.out.println(ans);
    }
    }

/*
* @Author: steve
* @Date:   2015-06-11 22:03:34
* @Last Modified by:   steve
* @Last Modified time: 2015-06-11 22:09:22
*/
import java.io.*;

public class AlmostPrime {
    public static void main(String[] args) throws Exception {
    	BufferedReader entrada = new BufferedReader(new InputStreamReader(System.in));
    	int n=Integer.parseInt(entrada.readLine());
    	int[] numeros = new int[n+1];
    	for(int i=2;i<=n;i++)
    		if(numeros[i]==0)
    			for(int j=i;j<=n;j+=i)
    				numeros[j]++;
    	int llevo=0;
    	for(int i=1;i<=n;i++)
    		if(numeros[i]==2) llevo++;
    	System.out.println(llevo);
    }
}

import java.util.*;
public class MyClass
{
    public static void main(String args[])
    {
      Scanner sc=new Scanner(System.in);
     long t=sc.nextLong();
      long prime[]=new long[3000000+1];
      long[] factor=new long[3000000+1];
      prime[0]=1;
      prime[1]=1;
      long ans=0;
      for(int i=2;i*i<=3000000;i++)
      {
          if(prime[i]==0)
          {
              factor[i]=1;
              for(int j=2*i;j<prime.length;j+=i)
              {
                  prime[j]=1;
                  factor[j]++;
              }
          }
      }
      for(int i=1;i<=t;i++)
      {
          if(factor[i]==2)
          {
              ans++;
          }
      }
      System.out.print(ans);
    }
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class ProblemA {

	public static void main(String[] args) throws IOException {
		BufferedReader s = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter out = new PrintWriter(System.out);

		boolean[] p = new boolean[3001];
		Arrays.fill(p, true);
		for (int i = 2 ; i <= 3000 ; i++) {
			if (p[i]) {
				for (int j = i*2 ; j <= 3000 ; j += i) {
					p[j] = false;
				}
			}
		}
		p[1] = false;

		int n = Integer.valueOf(s.readLine());
		int cnt = 0;
		for (int i = 1 ; i <= n ; i++) {
			if (isalmost(i, p)) {
				cnt++;
			}
		}
		out.println(cnt);
		out.flush();
	}

	private static boolean isalmost(int i, boolean[] p) {
		int pc = 0;
		for (int j = 1 ; j <= i ; j++) {
			if (i % j == 0) {
				if (p[j]) {
					pc++;
				}
			}
		}
		return (pc == 2);
	}

	public static void debug(Object... os){
		System.err.println(Arrays.deepToString(os));
	}
}

import java.util.Scanner;

public class A {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int ans = 0;
        for (int i = 1; i <= n; i++) {
            int t  = 0;
            for (int j = 2; j*j <= i ; j++) {
                if (i % j==0) {
                    if (prime(j))
                        t++;
                    if (j*j != i && prime(i/j))
                        t++;
                }
            }
            if (t==2)
                ans ++;
        }
        System.out.println(ans);
    }

    private static boolean prime(int n) {
        for (int i = 2; i*i <= n; i++) {
            if (n % i==0)
                return false;
        }
        return true;
    }
}

import java.io.*;
import java.util.*;

public class almostPrime {
    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }

    static ArrayList<Integer> primes = new ArrayList<>();
    static int[] b = new int[3005];

    public static void calPrimes() {
        Arrays.fill(b, 1);
        b[0] = b[1] = 0;
        for (int i = 2; i <= 3000; i++) {

            if (b[i] == 1) {
                primes.add(i);
                for (int j = i * i; j <= 3000; j += i) {
                    b[j] = 0;
                }
            }
        }
    }

    public static void main(String[] args) {
        FastReader sc = new FastReader();
        PrintWriter out = new PrintWriter(System.out);
        int n;
        n = sc.nextInt();
        calPrimes();
        // for (auto x : primes)
        // cout << x << ' ';
        int count = 0;
        for (int i = 2; i <= n; i++) {
            int c = 0;
            for (int x : primes) {
                if (i % x == 0)
                    c++;
            }
            if (c == 2)
                count++;
        }
        out.println(count);
        out.flush();

    }
}

import java .util.Scanner;
public class IEEE_tranning {

  public static void main(String[] args) {
      // prob. 4
    Scanner input = new Scanner(System.in);

     int n =input.nextInt() ;
   //  int m = input.nextInt();
     int [] a = new int [n+1];
     int count=0;

     for(int i=0;i<a.length;i++){

     if (  ! isPrime(i)  ){
         int t = (int) Math.sqrt(i);
      for(int g = 1 ; g <= t ; g++ ){
          if( i % g == 0){

           if( isPrime(i/g) && isPrime(g) && g != i/g) { a[i]+=2; }
           else if( isPrime(i/g) && isPrime(g) && g == i/g ){ a[i]++;   }
           else if(  isPrime(i/g)) { a[i]++; }
           else if ( isPrime(g) ){ a[i]++;  }
          }  }  }
     else { a[i]=0;}   }

       for(int i=0; i<a.length ;i++){
           if(a[i] == 2){count++;}  }

        System.out.println(count);
     }

  public static boolean isPrime(int num){
      if(num==1){ return false;}
      int y = (int) Math.sqrt(num);
      for(int d =2 ; d<= y ; d++ ){
          if(num % d == 0){ return false;}
      }
    return true;

  }

}

import java.io.*;
public class abv {
public static void main(String[]args)throws IOException
{
BufferedReader buf=new BufferedReader(new InputStreamReader(System.in));
int c=0;int c1=0;
int n=Integer.parseInt(buf.readLine());
for(int j=2;j<=n;j++)
{
for(int i=2;i<=j/2;i++)
{
if((isprime(i)&&((j%i==0))))
c++;
}
if(c==2)
c1++;
c=0;
}
System.out.println(c1);
}
public static boolean isprime(int a)
{
int l=0;
for(int i=2;i<=(int)Math.sqrt(a);i++)
{
if(a%i==0)
l++;
}
if(l==0)
return true;
else
return false;
}
}

import java.util.*;
import java.io.*;

public class AlmostPrime {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        //BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        //StringTokenizer st = new StringTokenizer(br.readLine());
        //PrintWriter pw = new PrintWriter("AlmostPrime.out");
        int n = sc.nextInt();
        boolean[] prime = new boolean[n+1];
        Arrays.fill(prime, true);
        for(int i = 2; i<=n; i++){
            if(prime[i]){
                for(int k = i+i; k<=n; k+=i)
                    prime[k] = false;
            }
        }

        int count = 0;
        for(int s = 2; s<=n; s++){
            int num = s;
            int c = 0;
            for(int i = 2; i<=s; i++){
                if(prime[i]){
                    if(s % i == 0) c++;
                    while(num % i == 0){
                        num /= i;
                    }
                }
            }
            if(c == 2){
                count++;
            }
        }
        System.out.println(count);
    }
}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.BufferedWriter;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.util.ArrayList;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author kahlled.95
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        TaskA solver = new TaskA();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskA {
        public void solve(int testNumber, InputReader in, OutputWriter out) {
            int n = in.nextInt();
            int count1 = 0, count2 = 0;
            boolean flag = true;
            ArrayList<Integer> list = new ArrayList<>();
            boolean[] isPrime = new boolean[n + 1];
            for (int i = 0; i < n; i++) {
                isPrime[i] = true;
            }
            isPrime[0] = isPrime[1] = false;
            for (int i = 2; i <= n; i++) {
                if (isPrime[i]) {
                    list.add(i);
                    for (int j = i * 2; j <= n; j += i) {
                        isPrime[j] = false;
                    }
                }
            }
//        for (int i = 2; i < n; i++) {
//            if (isPrime[i]) {
//                list.add(i);
//            }
//        }
            for (int i = 6; i <= n; i++) {
                for (int v : list) {
                    if (v > i) break;
                    if (i % v == 0)
                        count1++;
                    if (count1 > 2) {
                        flag = false;
                        break;
                    }

                }

                if (flag && count1 == 2)
                    count2++;
                count1 = 0;
                flag = true;

            }
            out.println(count2);
        }

    }

    static class OutputWriter {
        private final PrintWriter writer;

        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }

        public OutputWriter(Writer writer) {
            this.writer = new PrintWriter(writer);
        }

        public void close() {
            writer.close();
        }

        public void println(int i) {
            writer.println(i);
        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private InputReader.SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }
}

import java.util.*;

import java.math.*;
public class sq{

     public static void main(String []args){
         Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int curr=0;
        for(int i = 6; i<=n; i++){
            if(prime(i)){
                curr++;

                }
     }
            System.out.print(curr);
                }
     public static boolean prime(int n){
         int count = 0;
         for(int i = 2; i<=n; i++){
            if(n%i==0 && isPrime(i)){
                count++;
            }
         }
         if(count==2)
         return true;
         return false;
     }
     public static boolean isPrime(int n){
         int count=0;
         for(int i = 1; i<=n; i++){
            if(n%i==0){
                count++;
            }
         }
             if(count>2)
                return false;
            return true;
         }

}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class AlmostPrime
{
    public static void main(String[] args) throws IOException
    {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String linea = br.readLine();
        int n = Integer.parseInt(linea);
        int [] criba = new int[n];
        int [] results = new int[n];
        int result = 0;
        for (int i = 1; i < n; i++)
        {
            if (criba[i] == 0)
            {
                for (int j = i; j < n; j += (i+1))
                {
                    criba[j]=i+1;
                    results[j]++;
                }
            }
            if (results[i] == 2)
            {
                result++;
            }
        }
        System.out.println(result);
    }
}

import java.io.*;
import java.util.*;
import java.math.*;

public class a2oj {

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);

        int n = scan.nextInt();

        int ans = 0;

        for (int num = 1; num <= n; num++) {
            int c = 0;
            for (int i = 2; i <= num / 2; i++) {
                if (((num % i) == 0) && isPrime(i)) {
                    c++;
                }
            }
            if (c == 2)
                ans++;
        }

        System.out.print(ans);

        scan.close();
    }

    static boolean isPrime(int a) {
        int flag = 0;
        for (int k = 2; k <= a / 2; k++) {
            if ((a % k) == 0) {
                flag = 1;
                break;
            }
        }
        if (flag == 0)
            return true;
        else
            return false;
    }
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Scanner;
import java.util.StringTokenizer;

public class A26 {
	BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
	StringTokenizer st = null;

	private void solution() throws IOException {
		int n = nextInt();
		int m[] = new int[10000];
		int l = 0, p = 0;
		for (int i = 1; i < n + 1; i++) {
			p = 0;
			for (int j = 1; j < i + 1; j++) {
				if (i % j == 0) {
					m[i]++;
					if (m[j] == 2) {
						p++;
					}
				}
			}
			if (p == 2) {
				l++;
			}
		}
		System.out.print(l);
	}

	String nextToken() throws IOException {
		if (st == null || !st.hasMoreTokens()) {
			st = new StringTokenizer(bf.readLine());
		}
		return st.nextToken();
	}

	int nextInt() throws IOException {
		return Integer.parseInt(nextToken());
	}

	long nextLong() throws IOException {
		return Long.parseLong(nextToken());
	}

	double nextDouble() throws IOException {
		return Double.parseDouble(nextToken());
	}

	public static void main(String args[]) throws IOException {
		new A26().solution();
	}
}

/**
 * User: adityatj
 * Date: 4/28/12
 * Time: 9:31 PM
 * Contest:
 */

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;

public class Main {

    private static int[] p = new int[239];

    public static void main(String... args) throws IOException {

        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        generatePrimes();
        int limit = Integer.parseInt(in.readLine());
        int count = 0;
        for (int i = 4; i <= limit; i++) {
            if (isAlmostPrime(i))
                ++count;
        }
        System.out.println(count);
    }

    private static boolean isAlmostPrime(int num) {
        int c = 0;
        for(int i = 0; i < p.length; i++) {
            if(num % p[i] == 0)
                ++c;
            if(c > 2)
                return false;
        }
        if(c == 2)
            return true;
        return false;
    }

    private static void generatePrimes() {
        int start = 2;
        int end = 1500;
        int count = 0;
        boolean[] bool = new boolean[end + 1];
        for (int i = 2; i <= end / 2; i++) {
            if (bool[i] == false) {
                for (int j = 2 * i; j <= end; j += i) {
                    bool[j] = true;
                }
            }
        }
        for (int i = start, j = 0; i < bool.length; i++) {
            if (!bool[i]) {
                p[j] = i;
                ++j;
            }
        }
        //System.out.println(count);
    }
}

import java.util.Scanner;
public class Almostprime {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
    int n=sc.nextInt();
    int ans=0;
   for(int k=1;k<=n;k++)
   {
       int p=k;
       int count=0;
        for(int i=2;i<=k;i++)
    {
        if(p%i==0)
        {
            count++;
        while(p%i==0)
                 p=p/i;
        }
        if(count>2)
    break;
}
if(count==2)
    ans++;
continue;
}
System.out.println(ans);
    }
    }

import java.util.*;
import java.util.Map.Entry;

import java.io.*;
import java.math.*;
import static java.util.stream.Collectors.*;
import static java.util.Map.Entry.*;

/* Name of the class has to be "Main" only if the class is public. */
public class Main
{

	static int k;
	public static void main (String[] args) throws IOException
	{
		final long mod=(long) (1e9+7);
		Reader s=new Reader();
		  PrintWriter pt=new PrintWriter(System.out);
//		  BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
//		  int T=s.nextInt();
//		  int T=Integer.parseInt(br.readLine());
		  int T=1;
		  while(T-->0)
		  {
			  int n=s.nextInt();
			  int k=0;
			  for(int i=2;i<=n;i++) {
				  if(numberOfprimeFactors(i)==2)
					  k++;

			  }
			  pt.println(k);

		  }
		  pt.close();
	}
	public static int numberOfprimeFactors(int n)
    {
        // Print the number of 2s that divide n
		HashSet<Integer> hs = new HashSet<Integer>();
        while (n%2==0)
        {
            hs.add(2);
            n /= 2;
        }

        // n must be odd at this point.  So we can
        // skip one element (Note i = i +2)
        for (int i = 3; i <= Math.sqrt(n); i+= 2)
        {
            // While i divides n, print i and divide n
            while (n%i == 0)
            {
                hs.add(i);
                n /= i;
            }
        }

        // This condition is to handle the case whien
        // n is a prime number greater than 2
        if (n > 2)
            hs.add(n);
        return hs.size();
    }
	static int gcd(int a, int b)
    {
      if (b == 0)
        return a;
      return gcd(b, a % b);
    }
	static void dfs(int node, int parent, ArrayList<Integer> al[], long sts[], long afe[], int n) {
		for(int c:al[node]) {
			if(c!=parent) {
				dfs(c,node,al,sts,afe,n);
				sts[node]=sts[node]+sts[c];
			}
		}
//		System.out.println(k++);
		afe[k++]=(n-sts[node])*sts[node];
	}

	static void reverse(int arr[],int start, int end)
	{
		int temp;

		while (start < end)
		{
		    temp = arr[start];
		    arr[start] = arr[end];
		    arr[end] = temp;
		    start++;
		    end--;
		}
	}
	static void reverse(long arr[],int start, int end)
	{
		long temp;

		while (start < end)
		{
		    temp = arr[start];
		    arr[start] = arr[end];
		    arr[end] = temp;
		    start++;
		    end--;
		}
	}
	static boolean isPrime(int n)
    {
        // Corner cases
        if (n <= 1) return false;
        if (n <= 3) return true;

        // This is checked so that we can skip
        // middle five numbers in below loop
        if (n % 2 == 0 || n % 3 == 0) return false;

        for (int i = 5; i * i <= n; i = i + 6)
            if (n % i == 0 || n % (i + 2) == 0)
            return false;

        return true;
    }
	static int p2(int n) {
		int k=0;
		while(n>1) {
			if(n%2!=0)
				return k;
			n/=2;
			k++;
		}
		return k;
	}
	static boolean isp2(int n) {
		while(n>1) {
			if(n%2==1)
				return false;
			n/=2;
		}
		return true;
	}
	static int binarySearch(int arr[], int first, int last, int key){
		   int mid = (first + last)/2;
		   while( first <= last ){
		      if ( arr[mid] < key ){
		        first = mid + 1;
		      }else if ( arr[mid] == key ){
		        return mid;
		      }else{
		         last = mid - 1;
		      }
		      mid = (first + last)/2;
		   }
		   return -1;
		 }

	static void print(int a[][]) {
		for(int i=0;i<a.length;i++)
		{
			for(int j=0;j<a[0].length;j++)
				System.out.print(a[i][j]+" ");
			System.out.println();
		}
	}
	static int max (int x, int y) {
		return (x > y)? x : y;
	}
	static int search(Pair[] p, Pair pair) {
		int l=0, r=p.length;
		while (l <= r) {
	        int m = l + (r - l) / 2;
	        if (p[m].compareTo(pair)==0)
	            return m;
	        if (p[m].compareTo(pair)<0)
	            l = m + 1;
	        else
	            r = m - 1;
	    }
	    return -1;
	}
	static void pa(int a[])
	{
		for(int i=0;i<a.length;i++)
			System.out.print(a[i]+" ");
		System.out.println();

	}
	static void pa(long a[])
	{
		for(int i=0;i<a.length;i++)
			System.out.print(a[i]+" ");
		System.out.println();

	}
	static void reverseArray(int arr[],
            int start, int end)
	{
		int temp;

		while (start < end)
		{
		    temp = arr[start];
		    arr[start] = arr[end];
		    arr[end] = temp;
		    start++;
		    end--;
		}
	}
	static boolean isPalindrome(String s) {
		int l=s.length();
		for(int i=0;i<l/2;i++)
		{
			if(s.charAt(i)!=s.charAt(l-i-1))
				return false;
		}
		return true;
	}
	static long nc2(long n, long m) {
		return (n*(n-1)/2)%m;
	}
	static long c(long a) {
		return a*(a+1)/2;
	}
	static int next(int[] arr, int target)
    {
        int start = 0, end = arr.length - 1;

        int ans = -1;
        while (start <= end) {
            int mid = (start + end) / 2;

            // Move to right side if target is
            // greater.
            if (arr[mid] <= target) {
                start = mid + 1;
            }

            // Move left side.
            else {
                ans = mid;
                end = mid - 1;
            }
        }
        return ans;
    }

	static long power(long x, long y, long p)
    {
        long res = 1;
        x = x % p;

        while (y > 0)
        {
            if (y % 2 == 1)
                res = (res * x) % p;
            y = y >> 1;
            x = (x * x) % p;
        }
        return  res;
    }
    static long modInverse(long n, long p)
    {
        return power(n, p-2, p);
    }
    static long nCrModP(long n, long r,
                                    long p)
    {
        if (r == 0)
            return 1;
        long[] fac = new long[(int) (n+1)];
        fac[0] = 1;
        for (int i = 1 ;i <= n; i++)
            fac[i] = fac[i-1] * i % p;
        return (fac[(int) n]* modInverse(fac[(int) r], p)
                % p * modInverse(fac[(int) (n-r)], p)
                                    % p) % p;
    }
	static String reverse(String str)
	{
		return new StringBuffer(str).reverse().toString();
	}

	static long fastpow(long x, long y, long m)
    {
        if (y == 0)
            return 1;

        long p = fastpow(x, y / 2, m) % m;
        p = (p * p) % m;

        if (y % 2 == 0)
            return p;
        else
            return (x * p) % m;
    }

	static boolean isPerfectSquare(long l)
	{
		return Math.pow((long)Math.sqrt(l),2)==l;
	}

	static void merge(long[] arr, int l, int m, int r)
    {
        // Find sizes of two subarrays to be merged
        int n1 = m - l + 1;
        int n2 = r - m;

        /* Create temp arrays */
        long L[] = new long [n1];
        long R[] = new long [n2];

        /*Copy data to temp arrays*/
        for (int i=0; i<n1; ++i)
            L[i] = arr[l + i];
        for (int j=0; j<n2; ++j)
            R[j] = arr[m + 1+ j];

        /* Merge the temp arrays */

        // Initial indexes of first and second subarrays
        int i = 0, j = 0;

        // Initial index of merged subarry array
        int k = l;
        while (i < n1 && j < n2)
        {
            if (L[i] <= R[j])
            {
                arr[k] = L[i];
                i++;
            }
            else
            {
                arr[k] = R[j];
                j++;
            }
            k++;
        }

        /* Copy remaining elements of L[] if any */
        while (i < n1)
        {
            arr[k] = L[i];
            i++;
            k++;
        }

        /* Copy remaining elements of R[] if any */
        while (j < n2)
        {
            arr[k] = R[j];
            j++;
            k++;
        }
    }

    // Main function that sorts arr[l..r] using
    // merge()
    static void sort(int arr[], int l, int r)
    {
        if (l < r)
        {
            // Find the middle point
            int m = (l+r)/2;

            // Sort first and second halves
            sort(arr, l, m);
            sort(arr , m+1, r);

            // Merge the sorted halves
            merge(arr, l, m, r);
        }
    }
	static void merge(int arr[], int l, int m, int r)
    {
        // Find sizes of two subarrays to be merged
        int n1 = m - l + 1;
        int n2 = r - m;

        /* Create temp arrays */
        int L[] = new int [n1];
        int R[] = new int [n2];

        /*Copy data to temp arrays*/
        for (int i=0; i<n1; ++i)
            L[i] = arr[l + i];
        for (int j=0; j<n2; ++j)
            R[j] = arr[m + 1+ j];

        /* Merge the temp arrays */

        // Initial indexes of first and second subarrays
        int i = 0, j = 0;

        // Initial index of merged subarry array
        int k = l;
        while (i < n1 && j < n2)
        {
            if (L[i] <= R[j])
            {
                arr[k] = L[i];
                i++;
            }
            else
            {
                arr[k] = R[j];
                j++;
            }
            k++;
        }

        /* Copy remaining elements of L[] if any */
        while (i < n1)
        {
            arr[k] = L[i];
            i++;
            k++;
        }

        /* Copy remaining elements of R[] if any */
        while (j < n2)
        {
            arr[k] = R[j];
            j++;
            k++;
        }
    }

    // Main function that sorts arr[l..r] using
    // merge()
    static void sort(long arr[], int l, int r)
    {
        if (l < r)
        {
            // Find the middle point
            int m = (l+r)/2;

            // Sort first and second halves
            sort(arr, l, m);
            sort(arr , m+1, r);

            // Merge the sorted halves
            merge(arr, l, m, r);
        }
    }
    static class Pair implements Comparable<Pair>{
        int a;
        int b;
        Pair(int a,int b){
            this.a=a;

            this.b=b;
        }
        public int compareTo(Pair p){
            if(a>p.a)
                return 1;
            if(a==p.a)
                return (b-p.b);
            return -1;
        }
    }
	static class Reader
    {
        final private int BUFFER_SIZE = 1 << 16;
        private DataInputStream din;
        private byte[] buffer;
        private int bufferPointer, bytesRead;

        public Reader()
        {
            din = new DataInputStream(System.in);
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        public Reader(String file_name) throws IOException
        {
            din = new DataInputStream(new FileInputStream(file_name));
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        public String readLine() throws IOException
        {
            byte[] buf = new byte[64]; // line length
            int cnt = 0, c;
            while ((c = read()) != -1)
            {
                if (c == '\n')
                    break;
                buf[cnt++] = (byte) c;
            }
            return new String(buf, 0, cnt);
        }

        public int nextInt() throws IOException
        {
            int ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
            do
            {
                ret = ret * 10 + c - '0';
            }  while ((c = read()) >= '0' && c <= '9');

            if (neg)
                return -ret;
            return ret;
        }

        public long nextLong() throws IOException
        {
            long ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
            do {
                ret = ret * 10 + c - '0';
            }
            while ((c = read()) >= '0' && c <= '9');
            if (neg)
                return -ret;
            return ret;
        }

        public double nextDouble() throws IOException
        {
            double ret = 0, div = 1;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();

            do {
                ret = ret * 10 + c - '0';
            }
            while ((c = read()) >= '0' && c <= '9');

            if (c == '.')
            {
                while ((c = read()) >= '0' && c <= '9')
                {
                    ret += (c - '0') / (div *= 10);
                }
            }

            if (neg)
                return -ret;
            return ret;
        }

        private void fillBuffer() throws IOException
        {
            bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
            if (bytesRead == -1)
                buffer[0] = -1;
        }

        private byte read() throws IOException
        {
            if (bufferPointer == bytesRead)
                fillBuffer();
            return buffer[bufferPointer++];
        }

        public void close() throws IOException
        {
            if (din == null)
                return;
            din.close();
        }
    }
}

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Scanner;
import java.util.Set;

public class A {
	public static void main(String[] args) throws Exception {
		List<Set<Integer>> list = new ArrayList<Set<Integer>>();
		int n = new Scanner(System.in).nextInt();
		int c = 0;
		for(int i = 1; i <= n; ++i){
			Set<Integer> divs = new HashSet<Integer>();
			for(int d : propdiv(i)){
				Set<Integer> dl = list.get(d-1);
				if(dl.size()>0){
					divs.addAll(dl);
				}else{
					divs.add(d);
				}
			}
			list.add(divs);
			if(divs.size()==2){
				++c;
			}
		}
		System.out.println(c);

	}

	static Set<Integer> propdiv(int n) {
		Set<Integer> set = new HashSet<Integer>();
		for (int i = 2, j = n; i < j; i++) {
			if (n % i == 0) {
				set.add(i);
				set.add(j = n / i);
			}
		}
		return set;
	}
}

import java.util.Scanner;

public class AlmostPrime {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int cnt = 0;
        for(int i = 1;i <= n ; i++)
            if(check(i))
                cnt++;
        System.out.println(cnt);
    }
    static boolean check(int n){
        int primes = 0;
        for(int i = 2; i < n ; i++){
//            if(primes > 2)
//                return false;
            if(n%i==0 && isPrime(i))
                primes++;
                }
        return primes == 2;
    }
    static boolean isPrime(int n ){
        if(n < 2 )
            return false;
        for(int i = 2 ; i*i <= n;i++)
            if(n%i == 0)
                return false;
           return true;
    }
}

import java.util.*;

public class APrime
{
	public boolean isPrime(int n)
	{
		if(n == 2)
			return true;
		if(n < 2 || n % 2 == 0)
			return false;

		int m = (int)Math.sqrt(n) + 1;
		for(int i = 3; i < m; i += 2)
			if(n % i == 0)
				return false;
		return true;
	}

	public boolean isAPrime(int n)
	{
		int c = 0, i;

		for(i = 2; i < n - 1; ++i)
			if(n % i == 0)
				if(isPrime(i))
					++c;
		return c == 2;
	}

	public static void main(String[] args)
	{
		Scanner in = new Scanner(System.in);
		APrime a = new APrime();
		int c = 0, n = in.nextInt();

		for(int i = 1; i <= n; ++i)
			if(a.isAPrime(i))
				c += 1;
		System.out.println(c);
	}
}

import java.util.Scanner;
import java.util.HashSet;
import java.util.ArrayList;

public class AlmostPrime{

    public static int algorithm(int number){
        //the smallest almost prime number is 6.
        //working from top -> down is sure to consume too much time. What about a top-down approach?
        //no. generating a list of all prime numbers is also quite time consuming. Not all of them will be used, anyway.
        //and it's the same thing as top -> down.
        //and I refuse to hard code.
        //3 * 2 -> 6
        //3 * 3 * 2 -> 18
        //2 * 2 * 2 * 3 -> 24
        //2 * 7 * 3 -> 42

        ArrayList<Integer> primes = new ArrayList<>();
        int i = 2;

        int output = 0;

        while (i <= number){
            int upf = 0;
            //int lim = (int)Math.ceil(Math.sqrt(i));
            int lim = (int)Math.ceil((double)i/2);
            for (int j = 0; j < primes.size(); j++){
                if (primes.get(j) > lim){
                    break;
                }
                if (i % primes.get(j) == 0){
                    upf++;
                }
                if (upf > 2){
                    break;
                }
            }
            if (upf == 2){
                output++;
            }
            if (upf == 0){
                primes.add(i);
            }
            i++;
        }
        //System.out.println("Prime Numbers: " + primes.size());
        return output;

    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println(algorithm(sc.nextInt()));

        sc.close();

    }

}

import java.util.Scanner;
//codepi
public class divisor{
    public static void main(String args[]){
        Scanner scan = new Scanner(System.in);
        int num=scan.nextInt();
        int ans=0;
        for(int i=6;i<=num;i++){
            int x=i, t=2,count=0;
            while(x>1){
                if(x%t==0){
                    while(x%t==0){
                        x/=t;
                    }
                    count++;
                }
                t++;
            }
            if(count==2){
                ans++;
            }
        }
        System.out.println(ans);

    }
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class P26A_AlmostPrime {

	public static void main(String[] args) throws IOException {
		BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
		String line;
		StringBuilder sb = new StringBuilder();
		StringTokenizer st;
		while((line=bf.readLine()) != null){
			sb.append(line+"\n");
		}
		st = new StringTokenizer(sb.toString());

		int n = Integer.parseInt(st.nextToken());
		int res = 0;
		for (int i = 1; i <= n; i++) {
			if(almostPrime(i))
				res++;
		}
		System.out.println(res);

	}

	private static boolean almostPrime(int n) {
		if( 1 <= n && n <= 4)
			return false;
		int actual = 0;
		int unicos = 0;
		for (int j = 2; j <= n; j++) {
			while(n%j == 0){
				if(actual != j){
					actual = j;
					unicos++;
				}
				n /= j;
			}
			if(unicos > 2)
				return false;
		}
		if(unicos == 2)
			return true;
		return false;
	}

}

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;

public class AlmostPrimeCodeForces {

	private static void start(int n){
		boolean[] ret = new boolean[n];
		boolean[] prime = new boolean[n];
		Arrays.fill(ret, true);
		Arrays.fill(prime, false);
		ret[0]=ret[1]=ret[2]= false;
		prime[0]=true;
		prime[1]=true;
		for(int i=2;i<n;i+=2){
			prime[i-1]=false;
		}
		for(int i=5;i<Math.sqrt(n);i+=2){
			for(int j = 2;j<=Math.sqrt(i)+1;++j){
				if(j%i == 0){
					prime[i]=false;
					break;
				}
			}
		}
		int ct = 0;
		for(int i=4;i<n;++i){ct=0;
			for(int j=2;j<Math.sqrt(i);++j){
				if(prime[j-1] && i%j==0)++ct;
				if(ct>2){
					ret[i-1]=false;
					break;
				}
			}
		}
		ct=0;
		for(int i=0;i<n;++i){
			if(ret[i])++ct;
		}
		System.out.println(ct);
	}

	public static void main(String[] args) {
		try{
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.valueOf(reader.readLine());
		start(n);
		}catch(Exception e){
			e.printStackTrace();
		}
	}
}

import java.util.*;
public class Main{
     public static void main(String ... S){
          Scanner sc = new Scanner(System.in);
          int n = sc.nextInt();
          int count = 0;
          boolean primes[] = new boolean[10000];
          for(int i = 0; i<10000; i++){
               primes[i] = true;
          }
          primes[2] = true;
          primes[3] = true;
          for(int i = 2; i*i < n ; i++){
               if(primes[i] == true)
                for(int j = i*i; j<=n; j+=i)
                 primes[j] = false;
          }

          for(int i = 4; i<n; i++){
           if(i%2 == 0 && i%3 == 0) count++;
          }
          int c = 0;
          for(int i = 6; i<n; i++){
               if(primes[i] == true) c++;
          }
          if(n==1){
               System.out.println("0");
          }
          else if(n==8){
               System.out.println("1");
          }
          else
          System.out.println(c+count -1);

     }
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;

/**
 * @author Samuel
 */
public class Main {

	/**
	 * @param args
	 * @throws IOException
	 * @throws NumberFormatException
	 */
	public static void main(String[] args) throws NumberFormatException,
			IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(in.readLine());
		ArrayList<Integer> primes = new ArrayList<Integer>();
		primes.add(2);
		int MAX = 3000;
		boolean isPrime;
		for (int i = 3; i <= n; i += 2) {
			isPrime = true;
			for (int j = 1, len = primes.size(); j < len; j++) {
				if (i % primes.get(j) == 0) {
					isPrime = false;
					break;
				}
			}
			if (isPrime)
				primes.add(i);
		}

		int num, comb, total = 0, prime2;
		for (int i = 0, len = primes.size(); i < len; i++) {
			num = primes.get(i);
			for (; num <= n; num *= num) {
				for (int j = i + 1; j < len; j++) {
					prime2 = primes.get(j);
					for (comb = num * prime2; comb <= n; comb = comb * prime2) {
						total++;
					}
				}
			}
		}
		System.out.println(total);
	}

}

import java.util.Arrays;
import java.util.HashMap;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int x = in.nextInt();
        seive(3001);
        int counter = 0;
        for (int i = 5; i <= x; i++) {
            HashMap<Integer, Integer> check = new HashMap<>();
            for (int j = 2; j <= i; j++) {
                if (i % j == 0) {
                    if (p.get(j) != null) {
                        check.put(j, j);
                    }
                    if (p.get(i / j) != null) {
                        check.put(i / j, i / j);
                    }
                }
            }
            if (check.size() == 2) {
                counter++;
            }
        }
        System.out.println(counter);

    }
    static boolean[] primes;
    static HashMap<Integer, Integer> p;

    static void seive(int n) {
        primes = new boolean[n + 1];
        p = new HashMap<>();
        Arrays.fill(primes, true);
        primes[0] = primes[1] = false;
        for (int i = 2; i * i < n; i++) {
            if (primes[i]) {
                p.put(i, i);
                for (int j = i + i; j < n; j += i) {
                    primes[j] = false;
                }
            }
        }
    }
}

import java.io.*;
import java.util.*;

public class Factor
{
	static int max = 3000;
	static int minPrime[] = new int[max + 1];
	static void table()
	{
		for(int i = 2; i*i<=max; i++)
		{
			if(minPrime[i]==0)
			{
				for(int j = i*i; j<= max; j+=i)
				{
					if(minPrime[j]==0)
					{
						minPrime[j]=i;
					}
				}
			}
		}
		for(int i = 0; i<=max; i++)
		{
			if(minPrime[i]==0)
			{
				minPrime[i] = i;
			}
		}
	}

	public static void main(String args[])
	{
		table();
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int countDigit = 0;
		for(int i =2; i<=n; i++)
		{
			Vector<Integer> primeFactor = new Vector<Integer>();
			int a = i;
			int count = 1;
			while(a!=1 && count<4)
			{
				if(!primeFactor.contains(minPrime[a]))
				{
					primeFactor.add(minPrime[a]);
					count++;
				}
				a /= minPrime[a];
			}
			// System.out.println(primeFactor);
			if(primeFactor.size()==2)
			{
				System.out.println(i);
				countDigit++;
			}
			// System.out.println(countDigit);
		}
	}
}

import java.util.*;

public class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();

        int count = 0;
        for (int i = 2; i < n; i++)
        {
            int smallcount = 0;
            for (int j = 2; j < (int)(Math.sqrt(i)); j++)
            {
                if (i%j == 0)
                {
                    smallcount++;
                }
            }
            if (smallcount == 2)
            {
                count++;
            }
        }
        System.out.println(count);
    }
}

import java.io.*;
public class abv {
public static void main(String[]args)throws IOException
{
BufferedReader buf=new BufferedReader(new InputStreamReader(System.in));
int c=0;int c1=0;
int n=Integer.parseInt(buf.readLine());
for(int j=2;j<=n;j++)
{
for(int i=2;i<=(int)Math.sqrt(j);i++)
{
if((isprime(i)&&((j%i==0))))
c++;
}
if(c==2)
c1++;
c=0;
}
System.out.println(c1);
}
public static boolean isprime(int a)
{
int l=0;
for(int i=2;i<=(int)Math.sqrt(a);i++)
{
if(a%i==0)
l++;
}
if(l==0)
return true;
else
return false;

}
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import org.w3c.dom.ranges.Range;
import sun.font.CreatedFontTracker;

public class prime {
	static public int iprimeMass[];
	private static int[] initArr(int n){
		int[] iTmpArr=new int[n];
		for(int i=0;i<n;i++)
			iTmpArr[i]=i+1;
		return iTmpArr;
	}
	public static int[] createPrimeMass(int n){
		int iTmpArr[]=initArr(n);
		int count=0;
		//System.out.println(Arrays.toString(iTmpArr));
		for(int i=2;i<n/i;i++){
			for (int j=1; j<iTmpArr.length;j++){
				for (int t=j; t<iTmpArr.length;t++){
					if (i*iTmpArr[j]==iTmpArr[t]){
						iTmpArr[t]=0;
					}
				}
			}
		}
		count=0;
		for (int d=1; d<iTmpArr.length;d++){
			if (iTmpArr[d]!=0){
			count++;
			}
		}
		int[] res=new int[count];
		int k=0;
		for (int d=1; d<iTmpArr.length;d++){
			if (iTmpArr[d]!=0){
				res[k]=iTmpArr[d];
				k++;
			}
		}
		return res;
	}

	public static void main(String args[]) throws NumberFormatException, IOException{
		int q=0,n=0;

		BufferedReader d = new BufferedReader(new InputStreamReader(System.in));
		n = Integer.parseInt(d.readLine());
		iprimeMass=createPrimeMass(n);
		//System.out.println(Arrays.toString(iprimeMass));
		for(int i=2; i<=n;i++){
			int c=0;
			for (int j=0;j<iprimeMass.length;j++){
				if(iprimeMass[j]>=i) j=iprimeMass.length-1;
				if(i%iprimeMass[j]==0) c++;
			}
			if(c==2){q++;}
		}
		System.out.print(q);
	}
}

import java.io.*;
public class abv {
public static void main(String[]args)throws IOException
{
BufferedReader buf=new BufferedReader(new InputStreamReader(System.in));
int c=0;int c1=0;
int n=Integer.parseInt(buf.readLine());
for(int j=2;j<=n;j++)
{
for(int i=2;i<=j;i++)
{
if((isprime(i)&&((j%i==0))))
c++;
}
if(c==2)
c1++;
c=0;
}
System.out.println(c1);
}
public static boolean isprime(int a)
{
int l=0;
for(int i=1;i<=a/2;i++)
{
if(a%i==0)
l++;
}
if(l==2)
return true;
else
return false;
}
}

import java.util.*;

public class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();

        int count = 0;
        ArrayList<Integer> primes = new ArrayList<Integer>();
        for (int i = 1; i <= n; i++)
        {
            int smallcount = 0;
            for (int j = 1; j <= i; j++)
            {
                if (i%j == 0)
                {
                    smallcount++;
                }
            }
            if (smallcount == 2)
            {
                primes.add(i);
            }
        }

        for (int k = 0; k < primes.size(); k++)
        {
            int bigcount = 0;
            for (int m = 2; m <= n; m++)
            {
                if (m%(primes.get(k)) == 0)
                {
                    bigcount++;
                }
            }
            if (bigcount == 2)
            {
                count++;
            }
        }
        System.out.println(count);
    }
}

import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;

public class Solution {

  static int countPrime(int n)
  {
      int count=0;
      for (int i=2; i<n; i++)
      {

        if (n%i==0)
        {
            boolean b=new BigInteger(Integer.toString(i)).isProbablePrime(1);
            if (b)
            {
                count++;
            }
        }

      }
      return count;
  }
  public static void main(String[] args) {
    Scanner sc=new Scanner(System.in);

    int n=sc.nextInt();

    int count=0;
    for (int i=2; i<=n; i++)
    {
        if(countPrime(i)==2)
            count++;

    }
    System.out.println(count);
  }
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import org.w3c.dom.ranges.Range;
import sun.font.CreatedFontTracker;

public class prime {
	static public int iprimeMass[];
	private static int[] initArr(int n){
		int[] iTmpArr=new int[n];
		for(int i=0;i<n;i++)
			iTmpArr[i]=i+1;
		return iTmpArr;
	}
	public static int[] createPrimeMass(int n){
		int iTmpArr[]=initArr(n);
		for(int i=2;i<n;i++){
			for (int j=1; j<iTmpArr.length;j++){
				for (int t=1; t<iTmpArr.length;t++){
					if (i*iTmpArr[j]==iTmpArr[t])
						iTmpArr[t]=0;
				}
			}
		}
		int count=0;
		for (int d=1; d<iTmpArr.length;d++){
			if (iTmpArr[d]!=0){
			count++;
			}
		}
		int[] res=new int[count];
		int k=0;
		for (int d=1; d<iTmpArr.length;d++){
			if (iTmpArr[d]!=0){
				res[k]=iTmpArr[d];
				k++;
			}
		}
		return res;
	}

	public static void main(String args[]) throws NumberFormatException, IOException{
		int q=0,n=0;

		BufferedReader d = new BufferedReader(new InputStreamReader(System.in));
		n = Integer.parseInt(d.readLine());
		iprimeMass=createPrimeMass(n);
		for(int i=2; i<=n;i++){
			int c=0;
			for (int j=0;j<iprimeMass.length-i;j++){
				if(i%iprimeMass[j]==0) c++;
			}
			if(c==2){q++;}
		}
		System.out.print(q);
	}
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class AlmostPrime {
	public static void main(String[] args) {
		PrintWriter pw = new PrintWriter(System.out);
	    reader(System.in);
	    int n = nI();
	    int[] arr = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59};
	    int cnt = 0;
	    int k = 0, i = 6;
	    while (i <= n) {
	    	for (int j = 0; j < arr.length; j++) {
				if (i % arr[j] == 0) {
					k++;
				}
	    	}
	    	if (k == 2) {
	    		cnt++;
	    	}
	    	k = 0;
	    	i++;
	    }
	    pw.println(cnt);
	    pw.close();
	}

	private static BufferedReader br;
	private static StringTokenizer st;

	static void reader(InputStream stream) {
	    try {
	        br = new BufferedReader(new InputStreamReader(stream));
	    } catch (Exception e) {
	        e.printStackTrace();
	    }
	}

	static String n() {
	    while (st == null || !st.hasMoreTokens()) {
	        try {
	            st = new StringTokenizer(br.readLine());
	        } catch (IOException e) {
	            e.printStackTrace();
	        }
	    }
	    return st.nextToken();
	}

	static int nI() {
	    return Integer.parseInt(n());
	}

	static long nL() {
	    return Long.parseLong(n());
	}
}

import java.util.*;
import java.io.*;

public class AlmostPrime
{
	private static long[][] memo;
	private static long[][] nk;
	private static final int MAX = 510, mod = 100003;
	public static void main(String[] args) throws IOException
	{
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(in.readLine());
		try {
			int ans = new AlmostPrime().solve(n);
			System.out.println(ans);
		} catch (Exception e) {
			System.err.println(e);
		}
	}
	private boolean[] sieve(int n)
	{
		boolean[] prime = new boolean[n+1];
		Arrays.fill(prime, true);
		prime[0] = prime[1] = false;
		for (int i = 2; i*i <= n; ++i) {
			if (prime[i]) {
				for (int j = i+i; j <= n; j += i)
					prime[j] = false;
			}
		}
		return prime;
	}
	public int solve(int n)
	{
		boolean[] prime = sieve(n);
		int ret = 0;
		for (int i = 2; i*(i+1) <= n; ++i) {
			if (prime[i]) {
				for (int j = i+1; i*j <= n; ++j) {
					if (prime[j] && i*j <= n) {
						ret++;
						int x = i*i*j;
						while (x <= n) {
							ret++;
							x *= i;
						}
						x = i*j*j;
						while (x <= n) {
							ret++;
							x *= j;
						}
					}
				}
			}
		}
		return ret;
	}
}

import java.io.*;
import java.util.*;

/**
 * Created by aa on 1/06/2016.
 */
public class A {

    public static void main(String [] args) throws  Exception
    {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
        StringBuilder sb = new StringBuilder();
        int n = sc.nextInt();
        int  prime [] = new int[3001];
        boolean ok [] = new boolean[3001];
        Arrays.fill(ok, true);
        for(int i = 2  ; i * i <= 3001 ; ++i) {
            if(ok [i])
            {
                for(int j = 2 ; j * i <= 3001 ; ++j)
                {
                    ok[i*j] = false;
                    prime[i*j]++;
                }
            }
            else for(int j = 2 ; j * i <= 3001 ; ++j)
                ok[i*j] = false;

        }

        int cnt = 0;
        for(int i = 1 ; i<= n ;++i) cnt+= prime[i] == 2 ? 1 : 0;
        out.print(cnt);
        out.flush();
        out.close();
    }

    static class Scanner
    {
        StringTokenizer st;
        BufferedReader br;

        public Scanner(InputStream s){	br = new BufferedReader(new InputStreamReader(s));}

        public String next() throws IOException
        {
            while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(br.readLine());
            return st.nextToken();
        }

        public int nextInt() throws IOException {return Integer.parseInt(next());}

        public long nextLong() throws IOException {return Long.parseLong(next());}

        public String nextLine() throws IOException {return br.readLine();}

        public double nextDouble() throws IOException
        {
            String x = next();
            StringBuilder sb = new StringBuilder("0");
            double res = 0, f = 1;
            boolean dec = false, neg = false;
            int start = 0;
            if(x.charAt(0) == '-')
            {
                neg = true;
                start++;
            }
            for(int i = start; i < x.length(); i++)
                if(x.charAt(i) == '.')
                {
                    res = Long.parseLong(sb.toString());
                    sb = new StringBuilder("0");
                    dec = true;
                }
                else
                {
                    sb.append(x.charAt(i));
                    if(dec)
                        f *= 10;
                }
            res += Long.parseLong(sb.toString()) / f;
            return res * (neg?-1:1);
        }

        public boolean ready() throws IOException {return br.ready();}

    }
}

import java.util.Scanner;

public class AlmostPrime {

	public static void main(String[] args) {

		Scanner tc= new Scanner(System.in);

		int n=tc.nextInt();
		int count=0;
		for (int i = 1; i < n; i++) {
			if(almostPrime(i)) {
				count++;
			}
		}
		if(n==1) {
			System.out.println(0);
		}else {
			System.out.println(count+1);
		}
	}

	public static boolean almostPrime(int n) {
		int count=0;
		for (int i = 2; i < n; i++) {
			if(prime(i) && n%i==0) {
				count++;
			}
		}
		return count > 1 ? true:false;
	}

	public static boolean prime(int n) {
		for (int i = 2; i < n; i++) {
			if(n%i==0) {
				return false;
			}
		}
		return true;
	}

}

import java.util.*;

public class Trying
{
    public static void main (String[] args)
    {
        Scanner enter = new Scanner(System.in);
        int n = enter.nextInt(), number = 0, divisors = 0;
        for(int i = 2 ; i <= n ; i++)
        {
            divisors = 0;
            for(int j = 2 ; j <= i/2 ; j++)
            {
                if(i % j == 0 && prime(j) == 1) divisors++;
            }
            if(divisors == 2) number++;
        }
        System.out.println(number);
    }
    public static int prime(int n)
    {
        for(int i = 2 ; i < n/2 ; i++)
        {
            if(n % i == 0) return 0;
        }
        return 1;
    }
}

import java.io.*;
import java.math.*;
public class Main {

    /**
     * @param args
     */
    public static int find(int n)
    {
        BigInteger test=new BigInteger(String.valueOf(n));
        if (test.isProbablePrime(7)) return 1;
        else
        {
            BigInteger div=new BigInteger("2");
            while (test.mod(div).compareTo(BigInteger.ZERO)!=0) div=div.nextProbablePrime();
            while (test.mod(div).compareTo(BigInteger.ZERO)==0)
                test=test.divide(div);
            return test.intValue();
        }
    }
    public static boolean check(int n)
    {
        int count=0;
        while (n!=1)
        {
            count++;
            n=find(n);
        }
        return (count==2);
    }
    public static void main(String[] args) throws NumberFormatException, IOException {
        // TODO Auto-generated method stub
        BufferedReader in=new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out=new PrintWriter(System.out);
        int n=Integer.parseInt(in.readLine());
        int count=0;
        for (int i=6; i<=n; i++)
        {
            if (check(i)) { count++;}
        }
        out.println(count);
        out.close();
    }

}

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Comparator;
import java.util.StringTokenizer;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
/**
 *
 * @author Trung Pham
 */
public class A {

    public static void main(String[] args) {
        Scanner in = new Scanner();
        PrintWriter out = new PrintWriter(System.out);
        int n = in.nextInt();
        int [] prime = new int[n + 1];
        for(int i = 2 ; i < prime.length; i++){
            if(prime[i] == 0){
                for(int j = i + i; j < prime.length; j += i){
                    prime[j]++;
                }
            }
        }
        int result = 0;
        for(int i = 3; i < prime.length ; i++){
            if(prime[i] > 1){
                result++;
            }
        }
        out.println(result);

        out.close();
    }

    static class FT {

        int[] data;

        FT(int n) {
            data = new int[n];
        }

        void update(int index, int val) {
           // System.out.println("UPDATE INDEX " + index);
            while (index < data.length) {
                data[index] += val;
                index += index & (-index);

            //    System.out.println("NEXT " +index);
            }
        }

        int get(int index) {
          //  System.out.println("GET INDEX " + index);
            int result = 0;
            while (index > 0) {
                result += data[index];
                index -= index & (-index);
               // System.out.println("BACK " + index);
            }
            return result;
        }
    }

    static class Pair implements Comparable<Pair> {

        int a, b, c;

        public Pair(int a, int b, int c) {
            this.a = a;
            this.b = b;
            this.c = c;
        }

        @Override
        public int compareTo(Pair o) {
            if (a != o.a) {
                return a - o.a;
            } else {
                return o.b - b;
            }
        }
    }

    static int gcd(int a, int b) {
        if (b == 0) {
            return a;
        } else {
            return gcd(b, a % b);
        }
    }

    static int pow(int a, int b) {
        if (b == 0) {
            return 1;
        }
        if (b == 1) {
            return a;
        }
        int val = pow(a, b / 2);
        if (b % 2 == 0) {

            return val * val;
        } else {
            return val * val * a;
        }
    }

//    static Point intersect(Point a, Point b, Point c) {
//        double D = cross(a, b);
//        if (D != 0) {
//            return new Point(cross(c, b) / D, cross(a, c) / D);
//        }
//        return null;
//    }
//
//    static Point convert(Point a, double angle) {
//        double x = a.x * cos(angle) - a.y * sin(angle);
//        double y = a.x * sin(angle) + a.y * cos(angle);
//        return new Point(x, y);
//    }
    static Point minus(Point a, Point b) {
        return new Point(a.x - b.x, a.y - b.y);
    }

    static Point add(Point a, Point b) {
        return new Point(a.x + b.x, a.y + b.y);
    }

    static double cross(Point a, Point b) {
        return a.x * b.y - a.y * b.x;
    }

    static class Point {

        int x, y;

        Point(int x, int y) {
            this.x = x;
            this.y = y;
        }

        @Override
        public String toString() {
            return "Point: " + x + " " + y;
        }
    }

    static class Scanner {

        BufferedReader br;
        StringTokenizer st;

        public Scanner() {
            //System.setOut(new PrintStream(new BufferedOutputStream(System.out), true));
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        public String next() {

            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (Exception e) {
                    throw new RuntimeException();
                }
            }
            return st.nextToken();
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }

        public String nextLine() {
            st = null;
            try {
                return br.readLine();
            } catch (Exception e) {
                throw new RuntimeException();
            }
        }

        public boolean endLine() {
            try {
                String next = br.readLine();
                while (next != null && next.trim().isEmpty()) {
                    next = br.readLine();
                }
                if (next == null) {
                    return true;
                }
                st = new StringTokenizer(next);
                return st.hasMoreTokens();
            } catch (Exception e) {
                throw new RuntimeException();
            }
        }
    }
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class AlmostPrime
{
    public static void main(String[] args) throws IOException
    {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String linea = br.readLine();
        int n = Integer.parseInt(linea);
        int [] criba = new int[n];
        int [] results = new int[n];
        int result = 0;
        for (int i = 1; i < n; i++)
        {
            if (criba[i] == 0)
            {
                for (int j = i; j < n; j += (i+1))
                {
                    criba[j]=i+1;
                    results[j]++;
                }
            }
            if (results[i] == 1)
            {
                result++;
            }
        }
        System.out.println(result);
    }
}

import java.util.*;
public class prime{
    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int arr[] = new int[3001];
        int count = 0;
        for(int i=2;i<=n;i++)
        {
            for(int j=2;j<i;j++)
            {
                if(arr[j] == 0 && i%j == 0)
                {
                    arr[j]++;
                }
            }
            if(arr[i]==2)
            {
                count++;
            }
        }
        System.out.println(count);

    }
}

import java.util.*;

public class test
{
    public static void main(String[] args)
    {
        Scanner in=new Scanner(System.in);
        int n=in.nextInt();
        boolean[] primes=new boolean[n+1];

        Arrays.fill(primes,true);

        for(int i=2;i<=n;i++)
        {
            if(primes[i])
            {
        	int j=2;
        	while(i*j<=n)
        	{
        	    primes[i*j]=false;
        	    j++;
        	}
            }
        }

        int count=0;

        for(int i=6;i<=n;i++)
        {
            int c=0;
            for(int j=2;j<=n/2;j++)
            {
        	if(primes[j] && i%j==0)
        	    c++;

        	if(c==2)
        	    break;
            }

            if(c==2)
        	count++;
        }

        System.out.println(count);
    }
}

import java.util.*;
import java.math.*;
public class MyClass {
    public static void main(String args[]) {
        Scanner scan = new Scanner(System.in);
        int ulet = scan.nextInt();
        int result = 0;
        BigInteger prime;
        for(int x = 2 ; x<=ulet; x++){
            int counter = 0;
            for(int y=2; y<x; y++){
               prime = BigInteger.valueOf(y);
                if(prime.isProbablePrime(1)){
                    if(x%y == 0){
                        counter++;
                    }
                }
                if(counter > 2)
                    break;
            }
            if(counter == 2)
                result++;
        }
        System.out.print(result);
    }
}

/******************************************************************************

                            Online Java Compiler.
                Code, Compile, Run and Debug java program online.
Write your code in this editor and press "Run" button to execute it.

*******************************************************************************/
import java.util.*;
public class Main
{

    public static ArrayList<Integer> calculatePrime (int n ){
        BitSet b=new BitSet(n+1);
        for(int i=0;i<=n;i+=2){
            b.set(i);
        }
        b.set(1);
        b.clear(2);
        for(long i=3;i<=n;i++){
            for(long j=i*i; j<=n;j+=i){
                b.set((int)j);
            }
        }
        ArrayList<Integer> al=new ArrayList<Integer>();
        for(int i=0;i<=n;i++){
            if(b.get(i)==false){
                al.add(i);
            }
        }
        return al;
    }

	public static void main(String[] args) {
		Scanner obj=new Scanner(System.in);
		ArrayList<Integer> al=new ArrayList<Integer>();
		al=calculatePrime(4000);

		int n=obj.nextInt();
		int count=0,temp=0;
		if(n<=1){
		    System.out.println(0);
		}
		for(int i=2;i<=n;i++){
		    temp=0;
		    for(int j=0;j<=al.size();j++){
		        if(al.get(j)>i){
		            break;
		        }
		        if(i%al.get(j)==0){
		            temp++;
		        }
		    }
		    if(temp==2){
		        count++;
		    }
		}
		System.out.println(count);
	}
}

import java.util.Scanner;
public class C26A {

	public static void main(String[] args) {

		Scanner ah = new Scanner(System.in);

		int n = ah.nextInt() , i , a[] = new int[3001] , j;

		boolean b[] = new boolean[3001] , c[] = new boolean[3001];

		for(i = 2;i < 3000;i ++)
			if(!b[i])
				for(j = 2;j * i <= 3000;j ++)
					b[i*j] = true;

		for(i = 2;i <= n;i ++)
			for(j = 2;j < n;j ++)
				if(!b[j])
					for(int k = j + 1;k < n;k ++)
						if(!b[k] && i % j == 0 && i % k == 0)
							c[i] = true;

		int sum = 0;

		for(i = 1;i <= n;i ++)
			if(c[i])sum ++;

		System.out.println(sum);

	}

}

import java.io.*;
import java.util.*;
import java.math.*;
public class blaise{
    public static void main(String...args) throws java.lang.Exception{
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    ArrayList<Integer> almost = new ArrayList<Integer>();

    for(int x=1; x<=n; x++){
        if(checker(x)){
            almost.add(x);
            }
     }

    System.out.print(almost.size());
    }

    public static boolean checker(int x){
        int counter = 0;
        BigInteger c;
        ArrayList<Integer> factors = new ArrayList<Integer>();

        for(int i=1; i<=x; i++){
            if(x%i==0){
                factors.add(i);
            }
        }

        for(int i=0; i<=factors.size()-1; i++){
            c  = BigInteger.valueOf(factors.get(i));
            if(c.isProbablePrime(1) && !factors.contains(c))
                counter++;
        }

        if(counter == 2){
            return true;
        }
        return false;

    }
}

import java.util.*;
import java.math.*;
public class MyClass {
    public static void main(String args[]) {
        Scanner scan = new Scanner(System.in);
        int ulet = scan.nextInt();
        int result = 0;
        BigInteger prime;
        for(int x = 2 ; x<=ulet; x++){
            int counter = 0;
            for(int y=2; y<x; y++){
               prime = BigInteger.valueOf(y);
                if(prime.isProbablePrime(1)){
                    if(x%y == 0){
                        counter++;
                    }
                }
                if(counter > 2)
                    break;
            }
            if(counter == 2)
                result++;

        }
        System.out.print(result);
    }
}

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.io.StreamTokenizer;
import java.util.Arrays;

public class A {
	private static StreamTokenizer in;
	private static PrintWriter out;

	private static int nextInt() throws Exception {
		in.nextToken();
		return (int) in.nval;
	}

	private static String nextString() throws Exception {
		in.nextToken();
		return in.sval;
	}

	public static void main(String[] args) throws Exception {
		in = new StreamTokenizer(new BufferedReader(new InputStreamReader(
				System.in)));
		out = new PrintWriter(System.out);

		int NN = 3000, N = 55, n = 8;
		boolean[] sieve = new boolean[N + 1];
		Arrays.fill(sieve, true);
		sieve[0] = sieve[1] = false;
		for (int i = 2; i <= n; i++) {
			if (sieve[i]) {
				for (int j = i * i; j <= N; j += i) {
					sieve[j] = false;
				}
			}
		}

		int[] colls = new int[NN + 1];
		for (int i = 1; i <= NN; i++) {
			int c = 0;
			int ii = i;
			for (int j = 2; j <= N; j++) {
				if (sieve[j]) {
					if (ii % j == 0) {
						while (ii % j == 0) {
							ii /= j;
						}
						c++;
					}
				}
			}

			if (ii == 1 && c == 2) {
				colls[i]++;
			}
		}

		for (int i = 1; i <= NN; i++) {
			colls[i] += colls[i - 1];
		}

		out.println(colls[nextInt()]);

		out.flush();

	}
}

import java.util.*;
import java.io.*;
import java.math.*;
public class cf {
    static PrintWriter pw =new PrintWriter(new BufferedOutputStream(System.out),true);
    public static void main(String args[]) throws Exception {
	MyScanner sc = new MyScanner();
	int n=sc.nextInt(),cnt,ans=0;
	ArrayList<Integer> primes = new ArrayList<>();
	for(int i=2;i<=n;i++)
	    if(isPrime(i))primes.add(i);
	pw.println(primes);
	for(int i=2;i<=n;i++){
	    if(primes.contains(i))continue;
	    cnt = 0;
	    for(int x : primes){
		if(i<x)break;
		else if(i%x == 0)cnt++;
	    }
	    if(cnt == 2)ans++;
	}
	pw.println("\n"+ans);
	sc.close();
	pw.close();
    }
    private static boolean isPrime(int x){
	int t=(int)Math.sqrt(x);
	for(int i=2;i<=t;i++)if(x%i==0)return false;
	return true;
    }
}
class MyScanner {
    private final BufferedReader br;
    private StringTokenizer st;
    MyScanner() { br = new BufferedReader(new InputStreamReader(System.in)); }
    String next() throws IOException {
	if(st == null || !st.hasMoreElements())
	    st = new StringTokenizer(br.readLine());
	return st.nextToken();
    }
    char nextChar() throws IOException { return next().charAt(0); }
    int nextInt() throws IOException {	return Integer.parseInt(next()); }
    double nextDouble() throws IOException{ return Double.parseDouble(next()); }
    long nextLong() throws IOException { return Long.parseLong(next()); }
    boolean nextBoolean() throws IOException { return next().equals("true"); }
    String nextLine() throws IOException { return br.readLine(); }
    void close() throws IOException { br.close(); }
}

import java.io.*;
import java.math.*;
public class Main {

    /**
     * @param args
     */
    public static int find(int n)
    {
        BigInteger test=new BigInteger(String.valueOf(n));
        if (test.isProbablePrime(7)) return 1;
        else
        {
            BigInteger div=new BigInteger("2");
            while (test.mod(div).compareTo(BigInteger.ZERO)!=0) div=div.nextProbablePrime();
            while (test.mod(div).compareTo(BigInteger.ZERO)==0)
                test=test.divide(div);
            return test.intValue();
        }
    }
    public static boolean check(int n)
    {
        int count=0;
        while (n!=1)
        {
            count++;
            n=find(n);
        }
        return (count==2);
    }
    public static void main(String[] args) throws NumberFormatException, IOException {
        // TODO Auto-generated method stub
        BufferedReader in=new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out=new PrintWriter(System.out);
        int n=Integer.parseInt(in.readLine());
        int count=0;
        for (int i=6; i<n; i++)
        {
            if (check(i)) { count++;}
        }
        out.println(count);
        out.close();
    }

}

import java.util.*;

import java.math.*;
public class sq{

     public static void main(String []args){
         Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int curr=0;
        int t = 0;
        for(int i = 6; i<n; i++){
            if(prime(i)){
                curr++;

                }

     }
            System.out.print(curr);

     }
     public static boolean prime(int n){
         int count = 0;
         for(int i = 2; i<=n; i++){
            if(n%i==0 &&(new BigInteger(String.valueOf(i)).isProbablePrime(1))){
                count++;
            }
         }
         if(count>1)
         return true;
         return false;
     }

}

import java.util.*;
public class Main{
     public static void main(String ... S){
          Scanner sc = new Scanner(System.in);
          int n = sc.nextInt();
          int count = 0;
          boolean primes[] = new boolean[10000];
          for(int i = 0; i<10000; i++){
               primes[i] = true;
          }
          primes[2] = true;
          primes[3] = true;
          for(int i = 2; i*i < n ; i++){
               if(primes[i] == true)
                for(int j = i*i; j<=n; j+=i)
                 primes[j] = false;
          }

                 for(int i = 4; i<=n; i++){
               if(i%2 == 0 && i%3 == 0) count++;
          }
          for(int i = 4; i<=n; i++){
               if(primes[i] == true) count++;
          }
          System.out.println(count-1);
     }
}

import java.util.Scanner;
public class Test21 {
    public static void main(String[] args){
        Scanner in=new Scanner(System.in);
            int q=0;
            int x=in.nextInt();
            while(x--!=1)
                if(isPrime(x)==2)q++;
            System.out.println(q+1);
    }
    public static int isPrime(int n) {
        int c=0;
        for(int i=2;i<n;i++)
            if(n%i==0)
                if(Prime(i))c++;
            return c;
    }
    public static boolean Prime(int n){
        for(int i=2;i<n;i++)
            if(n%i==0)return false;
        return true;
    }
}

import java.io.*;
public class abv {
public static void main(String[]args)throws IOException
{
BufferedReader buf=new BufferedReader(new InputStreamReader(System.in));
int c=0;int c1=0;
int n=Integer.parseInt(buf.readLine());
for(int j=2;j<=n;j++)
{
for(int i=2;i<=j;i++)
{
if((isprime(i)&&((j%i==0))))
c++;
}
if(c==1)
c1++;
}
System.out.println(c1+1);
}
public static boolean isprime(int a)
{
int l=0;
for(int i=1;i<=a;i++)
{
if(a%i==0)
l++;
}
if(l==2)
return true;
else
return false;
}
}

import java.util.Arrays;
import java.util.Scanner;

public class asd {
	public static void main(String[] args){
		Scanner sc =new Scanner(System.in);
		int n=sc.nextInt();
		int[] x=new int[3001];
		int j=2;
		for(int i=0;i<(int)Math.sqrt(n);i++){
			while(x[j]!=0)
				j++;
			for(int k=j;k<=n;k+=j){
				x[k]++;
			}
		}
		int c=0;
		for(int i=0;i<n+1;i++){
			if(x[i]==2)
				c++;
		}
		System.out.println(c);
	}

}

import java.util.Scanner;

public class A_Almost_Prime {
public static void main(String[] args) {
	Scanner sc  = new Scanner(System.in);
	int n = sc.nextInt();
	boolean us[]=new boolean[30000];
	for (int i = 2; i <=3001; i++) {
		if(!us[i]){
			int k=2;
			while(k*i<=3001){
				us[k*i]=true;
				k++;
			}
		}
	}
	int c=0;
	int a[]=new int[3001];
	for (int i = 2; i <=3001; i++) {
		if(!us[i]){
			c++;
			a[c]=i;
		}
	}
	int ans =0;
	for (int i = 1; i <=n; i++) {
		int cnt=0;
		for (int j =1; j <=c; j++) {
			if(i%a[j]==0){
				cnt++;
			}
		}
		if(cnt>=2)
			ans++;
	}
	System.out.println(ans);
}
}

import java.util.Scanner;

/**
 * @author artyom
 */
public class AlmostPrime2 {
    private static final short MAX_PRIME_NUMBER = 3_000 / 2;
    private static final short[] primes = new short[MAX_PRIME_NUMBER + 1];

    static {
        generatePrimes();
    }

    private static void generatePrimes() {
        for (int i = 2, n = (int) Math.sqrt(MAX_PRIME_NUMBER); i <= n; i++) {
            if (primes[i] == 0) {
                for (int j = 2 * i; j <= MAX_PRIME_NUMBER; j += i) {
                    primes[j]++;
                }
            }
        }
    }

    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        short n = sc.nextShort();
        System.out.println(calcAlmostPrimes(n));
    }

    private static short calcAlmostPrimes(short n) {
        short c = 0;
        for (int i = 2; i <= n; i++) {
            if (primes[i] == 2) {
                c++;
            }
        }
        return c;
    }
}

import java.util.*;

public class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();

        int count = 0;
        for (int i = 2; i < n; i++)
        {
            int smallcount = 0;
            for (int j = 2; j < (int)(Math.sqrt(i)); j++)
            {
                if (i%j == 0)
                {
                    smallcount++;
                }
            }
            if (smallcount == 2)
            {
                count++;
            }
        }
        System.out.println(count);
    }
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.BitSet;

public class a26A {

        public static void main(String[] args) {
/*          new Thread(null, new Runnable() {
                public void run() {
                    new test().run();
                }
            }, "1", 1 << 23).start();*/

            new a26A().run();
        }

        public void run() {

            int n = 0;

            try {
                BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
                n = Integer.parseInt(in.readLine());
            }
            catch (IOException e)
            { }

            BitSet set = new BitSet(n);

            boolean t;
            int lp = 0;
            int p  = 2;
            while (lp < n )
            {
                while(lp < n)
                  {
                    t = true;
                    for(int d = 2; d < p; d++)
                      if(p % d == 0)
                      {
                        t = false;
                        break;
                      }
                    if(t)
                    {
                      set.set(p);
                      lp++;
                    }
                    p++;
                  }
            }
            set.set(2);

            int total = 0;
            for (int j = 0;j<n;j++)
            {
                int temp = 0;
                for (int i = set.nextSetBit(0); i >= 0; i = set.nextSetBit(i+1)) {
                    if (j % i ==0 )temp ++;
                    if (temp > 2) break;
                }
                if (temp == 2) {
                    System.out.println(j) ; total++;
                }
            }

            if (total!=0)
                System.out.println(total+1);
            else
                System.out.println(0);
        }
}

import java.util.*;
import java.math.*;
public class MyClass {
    public static void main(String args[]) {
        Scanner scan = new Scanner(System.in);
        int ulet = scan.nextInt();
        int result = 0;
        for(int x = 2 ; x<=ulet; x++){
            int counter = 0;
            for(int y=2; y<x; y++){
                boolean hep = true;
                for(int z = 2; z< y; z++){
                    if(y%z == 0)
                        hep = false;
                }
                if(hep){
                    if(x%y == 0){
                        counter++;
                    }
                }
                if(counter == 2)
                    break;
            }
            if(counter == 2)
                result++;
        }
        System.out.print(result);
    }
}

import java.util.*;

public class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();

        int count = 0;
        ArrayList<Integer> primes = new ArrayList<Integer>();
        for (int i = 2; i < n; i++)
        {
            int smallcount = 0;
            for (int j = 2; j < i; j++)
            {
                if (i%j == 0)
                {
                    smallcount++;
                }
            }
            if (smallcount == 1)
            {
                primes.add(i);
            }
        }
        for (int k = 0; k < primes.size(); k++)
        {
            int bigcount = 0;
            for (int m = 2; m <= n; m++)
            {
                if (m%primes.get(k) == 0)
                {
                    bigcount++;
                }
            }
            if (bigcount == 2)
            {
                count++;
            }
        }
        System.out.println(count);
    }
}

import java.util.*;
import java.util.Map.Entry;

import java.io.*;
import java.math.*;
import static java.util.stream.Collectors.*;
import static java.util.Map.Entry.*;

/* Name of the class has to be "Main" only if the class is public. */
public class Main
{

	static int k;
	public static void main (String[] args) throws IOException
	{
		final long mod=(long) (1e9+7);
		Reader s=new Reader();
		  PrintWriter pt=new PrintWriter(System.out);
//		  BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
//		  int T=s.nextInt();
//		  int T=Integer.parseInt(br.readLine());
		  int T=1;
		  while(T-->0)
		  {
			  int n=s.nextInt();
			  int x=0;
			  for(int i=2;i<=n;i++) {
				  int k=0;
				  for(int j=2;j*j<=i;j++) {
					  if(i%j==0) {
						  k+=isPrime(j)+isPrime(i/j);
						  if((j)==(i/j)) {
							  k-=1;
						  }
					  }
				  }
				  if(k==2) {
//					  pt.println(i);
					  x++;
				  }
			  }
			  pt.println(x);

		  }
		  pt.close();
	}
	static int gcd(int a, int b)
    {
      if (b == 0)
        return a;
      return gcd(b, a % b);
    }
	static void dfs(int node, int parent, ArrayList<Integer> al[], long sts[], long afe[], int n) {
		for(int c:al[node]) {
			if(c!=parent) {
				dfs(c,node,al,sts,afe,n);
				sts[node]=sts[node]+sts[c];
			}
		}
//		System.out.println(k++);
		afe[k++]=(n-sts[node])*sts[node];
	}

	static void reverse(int arr[],int start, int end)
	{
		int temp;

		while (start < end)
		{
		    temp = arr[start];
		    arr[start] = arr[end];
		    arr[end] = temp;
		    start++;
		    end--;
		}
	}
	static void reverse(long arr[],int start, int end)
	{
		long temp;

		while (start < end)
		{
		    temp = arr[start];
		    arr[start] = arr[end];
		    arr[end] = temp;
		    start++;
		    end--;
		}
	}
	static int isPrime(int n)
    {
        // Corner cases
        if (n <= 1) return 0;
        if (n <= 3) return 1;

        // This is checked so that we can skip
        // middle five numbers in below loop
        if (n % 2 == 0 || n % 3 == 0) return 0;

        for (int i = 5; i * i <= n; i = i + 6)
            if (n % i == 0 || n % (i + 2) == 0)
            return 0;

        return 1;
    }
	static int p2(int n) {
		int k=0;
		while(n>1) {
			if(n%2!=0)
				return k;
			n/=2;
			k++;
		}
		return k;
	}
	static boolean isp2(int n) {
		while(n>1) {
			if(n%2==1)
				return false;
			n/=2;
		}
		return true;
	}
	static int binarySearch(int arr[], int first, int last, int key){
		   int mid = (first + last)/2;
		   while( first <= last ){
		      if ( arr[mid] < key ){
		        first = mid + 1;
		      }else if ( arr[mid] == key ){
		        return mid;
		      }else{
		         last = mid - 1;
		      }
		      mid = (first + last)/2;
		   }
		   return -1;
		 }

	static void print(int a[][]) {
		for(int i=0;i<a.length;i++)
		{
			for(int j=0;j<a[0].length;j++)
				System.out.print(a[i][j]+" ");
			System.out.println();
		}
	}
	static int max (int x, int y) {
		return (x > y)? x : y;
	}
	static int search(Pair[] p, Pair pair) {
		int l=0, r=p.length;
		while (l <= r) {
	        int m = l + (r - l) / 2;
	        if (p[m].compareTo(pair)==0)
	            return m;
	        if (p[m].compareTo(pair)<0)
	            l = m + 1;
	        else
	            r = m - 1;
	    }
	    return -1;
	}
	static void pa(int a[])
	{
		for(int i=0;i<a.length;i++)
			System.out.print(a[i]+" ");
		System.out.println();

	}
	static void pa(long a[])
	{
		for(int i=0;i<a.length;i++)
			System.out.print(a[i]+" ");
		System.out.println();

	}
	static void reverseArray(int arr[],
            int start, int end)
	{
		int temp;

		while (start < end)
		{
		    temp = arr[start];
		    arr[start] = arr[end];
		    arr[end] = temp;
		    start++;
		    end--;
		}
	}
	static boolean isPalindrome(String s) {
		int l=s.length();
		for(int i=0;i<l/2;i++)
		{
			if(s.charAt(i)!=s.charAt(l-i-1))
				return false;
		}
		return true;
	}
	static long nc2(long n, long m) {
		return (n*(n-1)/2)%m;
	}
	static long c(long a) {
		return a*(a+1)/2;
	}
	static int next(int[] arr, int target)
    {
        int start = 0, end = arr.length - 1;

        int ans = -1;
        while (start <= end) {
            int mid = (start + end) / 2;

            // Move to right side if target is
            // greater.
            if (arr[mid] <= target) {
                start = mid + 1;
            }

            // Move left side.
            else {
                ans = mid;
                end = mid - 1;
            }
        }
        return ans;
    }

	static long power(long x, long y, long p)
    {
        long res = 1;
        x = x % p;

        while (y > 0)
        {
            if (y % 2 == 1)
                res = (res * x) % p;
            y = y >> 1;
            x = (x * x) % p;
        }
        return  res;
    }
    static long modInverse(long n, long p)
    {
        return power(n, p-2, p);
    }
    static long nCrModP(long n, long r,
                                    long p)
    {
        if (r == 0)
            return 1;
        long[] fac = new long[(int) (n+1)];
        fac[0] = 1;
        for (int i = 1 ;i <= n; i++)
            fac[i] = fac[i-1] * i % p;
        return (fac[(int) n]* modInverse(fac[(int) r], p)
                % p * modInverse(fac[(int) (n-r)], p)
                                    % p) % p;
    }
	static String reverse(String str)
	{
		return new StringBuffer(str).reverse().toString();
	}

	static long fastpow(long x, long y, long m)
    {
        if (y == 0)
            return 1;

        long p = fastpow(x, y / 2, m) % m;
        p = (p * p) % m;

        if (y % 2 == 0)
            return p;
        else
            return (x * p) % m;
    }

	static boolean isPerfectSquare(long l)
	{
		return Math.pow((long)Math.sqrt(l),2)==l;
	}

	static void merge(long[] arr, int l, int m, int r)
    {
        // Find sizes of two subarrays to be merged
        int n1 = m - l + 1;
        int n2 = r - m;

        /* Create temp arrays */
        long L[] = new long [n1];
        long R[] = new long [n2];

        /*Copy data to temp arrays*/
        for (int i=0; i<n1; ++i)
            L[i] = arr[l + i];
        for (int j=0; j<n2; ++j)
            R[j] = arr[m + 1+ j];

        /* Merge the temp arrays */

        // Initial indexes of first and second subarrays
        int i = 0, j = 0;

        // Initial index of merged subarry array
        int k = l;
        while (i < n1 && j < n2)
        {
            if (L[i] <= R[j])
            {
                arr[k] = L[i];
                i++;
            }
            else
            {
                arr[k] = R[j];
                j++;
            }
            k++;
        }

        /* Copy remaining elements of L[] if any */
        while (i < n1)
        {
            arr[k] = L[i];
            i++;
            k++;
        }

        /* Copy remaining elements of R[] if any */
        while (j < n2)
        {
            arr[k] = R[j];
            j++;
            k++;
        }
    }

    // Main function that sorts arr[l..r] using
    // merge()
    static void sort(int arr[], int l, int r)
    {
        if (l < r)
        {
            // Find the middle point
            int m = (l+r)/2;

            // Sort first and second halves
            sort(arr, l, m);
            sort(arr , m+1, r);

            // Merge the sorted halves
            merge(arr, l, m, r);
        }
    }
	static void merge(int arr[], int l, int m, int r)
    {
        // Find sizes of two subarrays to be merged
        int n1 = m - l + 1;
        int n2 = r - m;

        /* Create temp arrays */
        int L[] = new int [n1];
        int R[] = new int [n2];

        /*Copy data to temp arrays*/
        for (int i=0; i<n1; ++i)
            L[i] = arr[l + i];
        for (int j=0; j<n2; ++j)
            R[j] = arr[m + 1+ j];

        /* Merge the temp arrays */

        // Initial indexes of first and second subarrays
        int i = 0, j = 0;

        // Initial index of merged subarry array
        int k = l;
        while (i < n1 && j < n2)
        {
            if (L[i] <= R[j])
            {
                arr[k] = L[i];
                i++;
            }
            else
            {
                arr[k] = R[j];
                j++;
            }
            k++;
        }

        /* Copy remaining elements of L[] if any */
        while (i < n1)
        {
            arr[k] = L[i];
            i++;
            k++;
        }

        /* Copy remaining elements of R[] if any */
        while (j < n2)
        {
            arr[k] = R[j];
            j++;
            k++;
        }
    }

    // Main function that sorts arr[l..r] using
    // merge()
    static void sort(long arr[], int l, int r)
    {
        if (l < r)
        {
            // Find the middle point
            int m = (l+r)/2;

            // Sort first and second halves
            sort(arr, l, m);
            sort(arr , m+1, r);

            // Merge the sorted halves
            merge(arr, l, m, r);
        }
    }
    static class Pair implements Comparable<Pair>{
        int a;
        int b;
        Pair(int a,int b){
            this.a=a;

            this.b=b;
        }
        public int compareTo(Pair p){
            if(a>p.a)
                return 1;
            if(a==p.a)
                return (b-p.b);
            return -1;
        }
    }
	static class Reader
    {
        final private int BUFFER_SIZE = 1 << 16;
        private DataInputStream din;
        private byte[] buffer;
        private int bufferPointer, bytesRead;

        public Reader()
        {
            din = new DataInputStream(System.in);
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        public Reader(String file_name) throws IOException
        {
            din = new DataInputStream(new FileInputStream(file_name));
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        public String readLine() throws IOException
        {
            byte[] buf = new byte[64]; // line length
            int cnt = 0, c;
            while ((c = read()) != -1)
            {
                if (c == '\n')
                    break;
                buf[cnt++] = (byte) c;
            }
            return new String(buf, 0, cnt);
        }

        public int nextInt() throws IOException
        {
            int ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
            do
            {
                ret = ret * 10 + c - '0';
            }  while ((c = read()) >= '0' && c <= '9');

            if (neg)
                return -ret;
            return ret;
        }

        public long nextLong() throws IOException
        {
            long ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
            do {
                ret = ret * 10 + c - '0';
            }
            while ((c = read()) >= '0' && c <= '9');
            if (neg)
                return -ret;
            return ret;
        }

        public double nextDouble() throws IOException
        {
            double ret = 0, div = 1;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();

            do {
                ret = ret * 10 + c - '0';
            }
            while ((c = read()) >= '0' && c <= '9');

            if (c == '.')
            {
                while ((c = read()) >= '0' && c <= '9')
                {
                    ret += (c - '0') / (div *= 10);
                }
            }

            if (neg)
                return -ret;
            return ret;
        }

        private void fillBuffer() throws IOException
        {
            bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
            if (bytesRead == -1)
                buffer[0] = -1;
        }

        private byte read() throws IOException
        {
            if (bufferPointer == bytesRead)
                fillBuffer();
            return buffer[bufferPointer++];
        }

        public void close() throws IOException
        {
            if (din == null)
                return;
            din.close();
        }
    }
}

import java.util.ArrayList;
import java.util.Scanner;

public class A26 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int n = scanner.nextInt();

        ArrayList<Integer> primes = new ArrayList<Integer>();
        primes.add(2);
        for (int i = 3; i <= n; i++) {
            boolean check = true;

            for (int j = 2; j < i; j++) {
                if(i % j == 0) {
                    check = false;
                    break;
                }
            }

            if(check) {
                primes.add(i);
            }
        }

        int count = 0;
        for (int i = 6; i <= n; i++) {
            int localI = i;
            int deliteli = 0;
            for (int j = 0; j < primes.size(); j++) {
                if(localI % primes.get(j) == 0) {
                    int temp = localI;
                    localI /= primes.get(j);
                    deliteli++;

                    if(deliteli == 2 && !primes.contains(localI)) {
                        break;
                    }

                    if(deliteli > 2) {
                        break;
                    }
                }
            }
            if(deliteli == 2) {
                count++;
            }
        }

        System.out.println(count);
    }
}

/**
 *
 */
import java.util.Scanner;
/**
 * @author USER
 *
 */
public class AlmostPrime {

	/**
	 * @param args
	 */

	public static boolean isPrime(int num) {
		if(num<=1) {
			return false;
		}

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

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc=new Scanner(System.in);

		int num=sc.nextInt();
		int count=0, pcount=0;

		int n=0;

		if(num<6) {
			System.out.println("0");
		}

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

			for(int j=1;j<=n;j++) {
				if(n%j==0) {
					//약수일 경우, 소수인지 검사!
					if(isPrime(j)){
						count++;
					}
				}

				//
			}
			if(count==2) {
				pcount++;
			}

			count=0;

			n++;
		}
		System.out.println(pcount);

	}

}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) throws IOException {
        Scanner in = new Scanner(System.in);
        int n=in.nextInt();
        boolean[] notprime=new boolean[n+1];
        int l=(int) Math.sqrt(n);
        for(int i=2 ; i<l ; i++){
            if(!notprime[i]){
                for(int j=i+i ; j<=n ; j+=i){
                    notprime[j]=true;
                }
            }
        }
        int sum=0;
        ArrayList<Integer> list=new ArrayList<>();
        for(int i=2 ; i<notprime.length ; i++){
            if(!notprime[i]){
                list.add(i);
            }
        }
        for(int i=1 ; i<=n ; i++){
            int s=0;
            for(int j=0 ; j<list.size() && list.get(j)<=i/2 ; j++){
                if(i%list.get(j)==0){
                    s++;
                    if(s>2){
                        s=-1;
                        break;
                    }
                }
            }
            if(s==2){
                //System.err.println(i);
                sum++;
            }
        }
        System.out.println(sum);
    }
}

import java.util.Scanner;

public class AlmostPrime {

	public static void main(String[] args) {

		Scanner tc= new Scanner(System.in);

		int n=tc.nextInt();
		int count=0;
		for (int i = 1; i < n; i++) {
			if(almostPrime(i)) {
				count++;
			}
		}

		System.out.println(count+1);
	}

	public static boolean almostPrime(int n) {
		int count=0;
		for (int i = 2; i < n; i++) {
			if(prime(i) && n%i==0) {
				count++;
			}
		}
		return count > 1 ? true:false;
	}

	public static boolean prime(int n) {
		for (int i = 2; i < n; i++) {
			if(n%i==0) {
				return false;
			}
		}
		return true;
	}

}

import java.util.*;
import java.io.*;

public class AlmostPrime {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        //BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        //StringTokenizer st = new StringTokenizer(br.readLine());
        //PrintWriter pw = new PrintWriter("AlmostPrime.out");
        int n = sc.nextInt();
        boolean[] prime = new boolean[n+1];
        Arrays.fill(prime, true);
        for(int i = 2; i<=n; i++){
            if(prime[i]){
                for(int k = i+i; k<=n; k+=i)
                    prime[k] = false;
            }
        }

        TreeSet<Long> almostPrime = new TreeSet<>();
        for(int i = 2; i<=n; i++){
            for(int j = i+1; j<=n; j++){
                if(prime[i] && prime[j]){
                    long num = i*j;
                    almostPrime.add(num);
                    for(int b = 0; b <= (1 << 9); b++){
                        loop: for(int set = 0; set < 9; set++){
                            if((b & (1 << set)) > 0){
                                almostPrime.add(num*i);
                                num *= i;
                            }
                            else{
                                almostPrime.add(num*j);
                                num *= j;
                            }
                            if(num > n){
                                break;
                            }
                        }
                        num = i*j;
                    }
                }
            }
        }
        int count = 0;
        loop: for(long l : almostPrime){
            if(l > n){
                break loop;
            }
            else{
                count++;
            }
        }
        System.out.println(count);
        System.out.println(almostPrime);
    }
}

import java.util.*;
import java.io.*;

public class AlmostPrime {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        //BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        //StringTokenizer st = new StringTokenizer(br.readLine());
        //PrintWriter pw = new PrintWriter("AlmostPrime.out");
        int n = sc.nextInt();
        boolean[] prime = new boolean[n+1];
        boolean[] almost = new boolean[n+1];
        Arrays.fill(prime, true);
        for(int i = 2; i<=n; i++){
            if(prime[i]){
                for(int k = i+i; k<=n; k+=i)
                    prime[k] = false;
            }
        }

        TreeSet<Long> almostPrime = new TreeSet<>();
        for(int i = 2; i<=n; i++){
            for(int j = i+1; j<=n; j++){
                if(prime[i] && prime[j]){
                    long num = i*j;
                    almostPrime.add(num);
                    for(int b = 0; b <= (1 << 4); b++){
                        for(int set = 0; set < 4; set++){
                            if((b & (1 << set)) > 0){
                                almostPrime.add(num*i);
                                num *= i;
                            }
                            else{
                                almostPrime.add(num*j);
                                num *= j;
                            }
                        }
                        num = i*j;
                    }
                }
            }
        }
        int count = 0;
        for(long l : almostPrime){
            if(l > n){
                break;
            }
            else{
                count++;
            }
        }
        System.out.println(count);
    }
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Words {

public static void main(String[] args) throws IOException {

BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String st = br.readLine();
int max = Integer.parseInt(st);
String[] cri = new String[ max ];

for( int c = 0 ; c < max ; c++){
cri[c] = "1";
}

for( int i = 2; i<= (int) max/2 ; i++){
if( cri[i-1].length() == 1){
for( int j = 2; j*i<=max ; j++){
cri[i*j - 1] += i;
}
}
}

int res = 0;

for(int d = 2; d<=max ; d++){
if(cri[d-1].length() == 3){
res++;
}
}

System.out.println(res);

}
}

import java.util.*;

public class Main{

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int x = in.nextInt();
        int con = 1;
        if (x > 5) {
            for (int i = 10; i <= x; i++) {
                int y = Div(i);
                if (y == 2) {
                    con++;
                }
            }
            System.out.println(con);
        } else {
            System.out.println(0);
        }
    }

    public static int Div(int x) {
        ArrayList<Integer> tr = new ArrayList<>();
        boolean primo[] = new boolean[x + 1];
        Arrays.fill(primo, true);
        for (int i = 2; i <= x; i++) {
            if (primo[i] == true) {
                for (int j = i * 2; j <= x; j += i) {
                    primo[j] = false;
                }
                tr.add(i);
            }
        }
        int con = 0;
        for (int j = 0; j < tr.size(); j++) {
            if (x % tr.get(j) == 0) {
                con++;
            }
            if (con == 2) {
                break;
            }

        }
        return con;
    }
}

import java.util.*;
import java.math.*;
public class MyClass {
    public static void main(String args[]) {
        Scanner scan = new Scanner(System.in);
        int ulet = scan.nextInt();
        int result = 0;
        BigInteger prime;
        for(int x = 2 ; x<=ulet; x++){
            int counter = 0;
            for(int y=2; y<x; y++){
               prime = BigInteger.valueOf(y);
                if(prime.isProbablePrime(1)){
                    if(x%y == 0){
                        counter++;
                    }
                }
                if(counter > 2)
                    break;
            }
            if(counter == 2)
                result++;
        }

        System.out.print(result);
    }
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.StringTokenizer;

public class CodeforceSol13a {
	static FastScanner in;
	static PrintWriter out;

	public static class FastScanner{
		BufferedReader br;
		StringTokenizer st;

		public FastScanner(InputStream in){
			br = new BufferedReader(new InputStreamReader(in));
		}

		String next(){
			while (st == null || !st.hasMoreElements()){
				try{
					st = new StringTokenizer(br.readLine());
				} catch (IOException e){
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt(){
			return Integer.parseInt(next());
		}

		long nextLong(){
			return Long.parseLong(next());
		}

		double nextDouble(){
			return Double.parseDouble(next());
		}
	}
	public static final int MAXPRIMENUM = 3001;
	static int[] primeFactorNum = new int[MAXPRIMENUM];

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		in = new FastScanner(System.in);
		out = new PrintWriter(System.out);

		initializeTable();
		for(int c : primeFactorNum){
			System.out.println(c);
		}

		int n = in.nextInt();
		int res = calculateAlmostPrime(n);
		out.println(res);

		out.close();
	}

	private static int calculateAlmostPrime(int n) {
		// TODO Auto-generated method stub
		int num = 0;
		for(int i = 0; i <= n; i++){
			if(primeFactorNum[i] == 2){
				num++;
			}
		}
		return num;
	}

	private static void initializeTable() {
		// TODO Auto-generated method stub
		Arrays.fill(primeFactorNum, 0);
		for(int i = 2; i < MAXPRIMENUM; i++){
			if(primeFactorNum[i] == 0){
				for(int j = 2; j * i < MAXPRIMENUM; j++){
					primeFactorNum[j * i] += 1;
				}
			}
		}
	}

}

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Scanner;

public class AlmostPrime {

    public void solve() {
        Scanner sc = new Scanner(System.in);
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        int i = 0, j = 0, k = 0;
        int ans = 0, sum = 0, count = 0;
        int n = sc.nextInt();

        boolean primes[] = new boolean[4000];
        for (i = 0; i < 3005; ++i) {
            if (isPrime(i)) {
                primes[i] = true;
            }
        }

        for (i = 2; i <= n; ++i) {
            if (!primes[i]) {

                ABC:
                for (j = 0; j <= i; ++j) {
                    if (primes[j] && i % j == 0) {
                        k = i / j;
                        while (true) {
                            if (k % j == 0) {
                                k /= j;
                            } else {
                                sum++;
                                break ABC;
                            }
                            if (k == 1) {
                                break ABC;
                            }
                        }
                    }
                }

            }
        }

        System.out.println(sum);

    }

    public static boolean isPrime(int n) {
        if (n == 0 || n == 1) {
            return false;
        }
        int i = 2;
        double a = Math.sqrt(Math.abs(n));
        while (i <= a) {
            if (n % i == 0) {
                return false;
            }
            ++i;
        }
        return true;
    }

    public static void main(String[] args) {
        new AlmostPrime().solve();

    }
}

import java.util.*;

public class Main {

    public static void main(String[] args) throws Exception {
        Scanner in = new Scanner(System.in);
        int n=in.nextInt();
        int as[]=new int[1000];
        Arrays.fill(as,1);
        as[0]=2;
        int counter=1;
        for(int i=2;i<=n;i++){
            if(pros(i)){
                as[counter++]=i;
            }
        }
        int ans=0;
        int l=0;
        for(int i=2;i<=n;i++){
            for(int j=0;j<1000;j++){
                if(as[j]==1)
                    break;
                if(i%as[j]==0){
                    for(int k=j+1;k<1000;k++){
                        if(as[k]==1){
                            break;
                        }
                        if(i%as[k]==0){
                            ans++;
                        }
                    }
                }
            }
        }
        System.out.print(ans);
    }
    static boolean pros(int a){
        boolean f=true;
        for(int i=2;i<=Math.ceil((double)Math.sqrt(a));i++){
            if(a%i==0){
                f=false;
                break;
            }
        }
        return f;
    }
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.text.DecimalFormat;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;

public class AlmostPrime {

    static BufferedReader IN;
    static {
        try {
//          IN = new BufferedReader(new FileReader(new File(A.class.getResource("t.txt").toURI())));
            IN = new BufferedReader(new InputStreamReader(System.in));
        }
        catch(Exception e) {
            e.printStackTrace();
        }
    }

    static String inStr() {
        try {
            return IN.readLine();
        } catch (IOException e) {
            e.printStackTrace();
            throw new RuntimeException(e);
        }
    }
    static int inInt() { return Integer.parseInt(inStr()); }

    static int[] inIntArr() {
        String s = inStr();
        if(s == null)
            return null;
        return toIntArr(s);
    }
    static int[] toIntArr(String s) {
        String[] sArr = s.split(" ");
        int[] iArr = new int[sArr.length];
        for(int i = 0; i < sArr.length; ++i)
            iArr[i] = Integer.parseInt(sArr[i]);
        return iArr;
    }
    static void out(String s) { System.out.println(s); }
    static void out(int i) { out(Integer.toString(i)); }
    static void out(double x) {
        out(format(x));
    }
    static final DecimalFormat df = new DecimalFormat("0.000000");
    private static String format(double x) {
        String s = df.format(x);
        s = s.replaceAll(",", ".");
        return s;
    }

    static int[] sieve(int n) {
        Set<Integer> nonPrimes = new HashSet<Integer>();
        for(int i = 2; i <= n; ++i) {
            int p = i + i;
            while(p <= n) {
                nonPrimes.add(Integer.valueOf(p));
                p += i;
            }
        }

        int[] primes = new int[n - nonPrimes.size() - 1];
        int index = 0;
        for(int i = 2; i <= n; ++i) {
            if(!nonPrimes.contains(Integer.valueOf(i))) {
                primes[index++] = i;
                //System.out.println(i);
            }
        }
        return primes;
    }

    public static void main(String[] args) {

        int n = inInt();
        int[] primes = sieve(n);
        int count = 0;
        for(int i = 1; i <= n; ++i) {
            boolean almostPrime = false;
            for (int j = 0; !almostPrime && j < primes.length; j++) {
                if(i == primes[j]) break;

                if(i % primes[j] == 0) {
                    int p = i/primes[j];
                    while(p % primes[j] == 0) p = p/primes[j];

                    for (int k = j + 1; !almostPrime && k < primes.length; k++) {
                        if(p % primes[k] == 0) {
                            p = p/primes[k];
                            while(p % primes[k] == 0) p = p/primes[k];

                            boolean third = false;
                            for (int l = 0; !third && l < primes.length; l++) {
                                if(primes[l] == l || p % primes[l] == 0)
                                    third = true;
                            }

                            if(!third) almostPrime = true;
                        }
                    }
                }
            }
            if(almostPrime)
                ++count;
        }
        out(count);
    }

}

import java.io.File;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.Arrays;
import java.util.Scanner;

public class Main {

	/**
	 * @param args
	 */

	public static void main(String[] args) throws Exception {
		Main task = new Main();
		task.run();

	}

	Scanner inp;
	PrintWriter out;
int[] notpr;
	int[] sundaram(int n) {
		int count = n;

		int[] a = new int[n + 1];
		int i, j;
		a[0] = 0;
		a[1] = 1;
		for (i = 2; i<=n;i++)
			for (j=i+1;j<=n;j++)
				if ((j%i==0))a[j] = 1;
		j = 0;
		int d = 0;
		notpr = new int[n];
		int[] ans = new int[count-1];
		for (i = 1; i < n; i++) {
			if (a[i] == 0) {
				ans[j] = i;
				j++;
			}
			else
			{
				notpr[d] = i;
				d++;
			}

		}
		return ans;
	}

	private void run() throws Exception {
		inp = new Scanner(System.in);
		out = new PrintWriter(System.out);
		int n = inp.nextInt();
		int[] spis = sundaram(n);
		int c = spis.length;
		int ans = 0;
		for (int i =0;i<=n;i++)
		{
			int cc = 0;
			for (int j = 0;j<c;j++)
				if (spis[j]!=0) if (i%spis[j]==0)cc++;
			if (cc==2) ans++;
		}
		out.print(ans);

		inp.close();
		out.close();

	}

}

import java.io.*;
import java.util.*;
import java.math.*;
public class blaise{
    public static void main(String...args) throws java.lang.Exception{
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    ArrayList<Integer> almost = new ArrayList<Integer>();

    for(int x=1; x<=n; x++){
        if(checker(x)){
            almost.add(x);
            }
     }
    System.out.print(almost.size());
    }
    public static boolean checker(int x){
        int counter = 0;
        BigInteger c;
        ArrayList<Integer> factors = new ArrayList<Integer>();

        for(int i=1; i<=x; i++){
            if(x%i==0){
                factors.add(i);
            }
        }

        for(int i=0; i<=factors.size()-1; i++){
            c  = BigInteger.valueOf(factors.get(i));
            if(c.isProbablePrime(1) && !factors.contains(c))
                counter++;
        }

        if(counter == 2){
            return true;
        }
        return false;

    }
}

import java.util.Scanner;

public class Task26A {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		sc.close();

		if (n < 6) {
			System.out.println(0);
			return;
		}

		int[] pr = new int[1000];
		pr[0] = 2;
		pr[1] = 3;
		int pc = 2;
		ext:
		for (int i = 5; i <= n / 2; i += 2) {
			for (int j = 1; j < pc; j++) {
				if (i % pr[j] == 0) {
					continue ext;
				}
			}
			pr[pc] = i;
			pc++;
		}

		int res = 0;
		for (int i = 0; i < pc - 1; i++) {
			for (int j = i + 1; j < pc; j++) {
				if (pr[i] * pr[j] > n) { break; }
				res++;
			}
		}

		System.out.println(res);
	}
}

import java.io.*;
public class abv {
public static void main(String[]args)throws IOException
{
BufferedReader buf=new BufferedReader(new InputStreamReader(System.in));
int c=0;int c1=0;
int n=Integer.parseInt(buf.readLine());
for(int j=2;j<=n;j++)
{
for(int i=2;i<=j/2;i++)
{
if((isprime(i)&&((j%i==0))))
c++;
}
if(c==2)
c1++;
c=0;
}
System.out.println(c1);
}
public static boolean isprime(int a)
{
int l=0;
for(int i=1;i<=a/2;i++)
{
if(a%i==0)
l++;
}
if(l==2)
return true;
else
return false;
}
}

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class RENAMETHISBITCH {

	public static void main(String[] args) {

		try (Scanner sc = new Scanner(System.in)) {

			int n = sc.nextInt();
			List<Integer> primes = new ArrayList<>();

			for (int i = 2; i <= n / 2; i++) {
				boolean isPrime = true;
				for (int prime : primes) {
					if (i % prime == 0) {
						isPrime = false;
						break;
					}
				}
				if (isPrime) {
					primes.add(i);
					int x = i * i;

					while (x <= n) {
						primes.add(x);
						x *= i;
					}
				}
			}
			System.out.println(primes);

			int count = 0;
			for (int i = 0; i < primes.size() - 1; i++) {
				for (int j = i + 1; j < primes.size(); j++) {
					if (primes.get(i) * primes.get(j) <= n && primes.get(j) % primes.get(i) != 0) {
						System.out.println(primes.get(i) + " x " + primes.get(j) + " = " + (primes.get(i) * primes.get(j)));
						count++;
					}
				}
			}
			System.out.println(count);
		}
		catch (Exception e) {
			e.printStackTrace();
		}
	}
}

import java.util.Arrays;
import java.util.Scanner;

public class Test {

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
	    int n = s.nextInt();

		int[] temp = new int[n+1 ];
		for (int i = 0; i < n+1; i++) {
			temp[i] = 0;
		}
		System.out.println(Arrays.toString(temp));
		for(int j =2;j<n;j++) {
			if(temp[j] != 0) {
				continue;
			}
			for(int k =j;k<=n;k++) {
				if(k%j == 0) {
					temp[k] =  temp[k] +1;
					}
			}
		}
		/*for (int k = 2; k < n; k++) {
			for (int j = 2; j < n; j++) {
				if (temp[j-1] == 0) {
					if (j % k == 0) {
						temp[j-1] = temp[j-1] + 1;
					}
				}

			}

		}*/
		int count =0;
		for(int i=0 ;i<n+1;i++) {
			if(temp[i] ==2) {
				count++;
			}
		}
		System.out.println(count);
	}

}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;

public class DvorkinSimpleDigit {

    static int[] simple;
    static int[] thissimple;
    static PrintWriter out;
    static BufferedReader br;
    static int summ=0,tmp;

    public static void main(String[] args) throws InterruptedException, IOException {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        String str = in.readLine();
        int size = Integer.parseInt(str);
        if(size <= 5){
            System.out.print(0);
            return;}
        thissimple = new int[239];
        simple = new int[239];
        createsimple();
        int kol=0;
        for(int i = 6;i<=size;i++){
            if (almostsimple(i)==true) kol++;
        }
        System.out.print(kol);
    }

    private static void createsimple(){
        int k=0;
        boolean flag=true;
        for(int j=2;j<1500;j++){
            flag = true;
            for(int i=2; i<=(int)(Math.sqrt(j));i++){
                if(j%i == 0){flag = false; break;}
            }
            if (flag == true)
                simple[k++] = j;
        }
    }

    private static boolean almostsimple(int a) {
        while(a > 1){
            tmp = testsimple(a);
            if (tmp == -1)
                return false;
            a = (int)a/simple[tmp];
            thissimple[tmp] = 1;
            }
        summ = 0;
        for(int i=0;i<16;i++){
            summ = summ + thissimple[i];
            thissimple[i] = 0;
        }
        if (summ == 2) return true;
        return false;
        }

    private static int testsimple(int a) {
        for(int i=0;i<simple.length;i++){
            if(a % simple[i] == 0)
                return i;
        }
        return -1;
    }

}

import java.util.*;
public class Project_euler4 {

	public static void main(String[] args) {

		Scanner sc=new Scanner(System.in);

		int[] prime=new int[3001];
		prime[0]=1;
		prime[1]=1;
		for(int i=2;i*i<=3000;i++)
		{
			if(prime[i]==0)
			for(int j=2*i;j<prime.length-1;j+=i)
			{
				prime[j]=1;
			}
		}

		int t=sc.nextInt();
		int ans=0;
		for(int i=6;i<=t;i++)
		{
			int c=0;
			int v=(int)Math.sqrt(i);
			for(int j=1;j<=v;j++)
			{
				if(i%j==0)
				{
					if(prime[j]==0)
						c++;
					if(prime[i/j]==0)
						c++;
				}
			}
			if(v*v==i)
				c--;
			if(c==2)
				ans++;
		}

		System.out.println(ans);
	}

}

import java.util.*;

public class PA {
    public static void main(String[] args) {
        new PA().run();
    }

    private void run() {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();

        Set<Integer> prime = new TreeSet<>();
        main:
        for (int i = 2; i < Math.sqrt(3000); i++) {
            for (int p : prime)
                if (i % p == 0) continue main;
            prime.add(i);
        }

        int r = 0;
        for (int i = 2; i <= n; i++) {
            for (int first : prime) {
                if (i % first != 0) continue;

                int second = i / first;
                while (second % first == 0) second /= first;

                if (second != 1 && prime.contains(second)) {
                    r++;
                    break;
                }
            }
        }

        System.out.println(r);
    }
}

import java.io.*;
public class abv {
public static void main(String[]args)throws IOException
{
BufferedReader buf=new BufferedReader(new InputStreamReader(System.in));
int c=0;int c1=0;
int n=Integer.parseInt(buf.readLine());
for(int j=2;j<=n;j++)
{
for(int i=2;i<=j;i++)
{
if((isprime(i)&&((j%i==0))))
c++;
}
if(c==1)
c1++;
}
System.out.println(c1+1);
}
public static boolean isprime(int a)
{
int l=0;
for(int i=1;i<=a;i++)
{
if(a%i==0)
l++;
}
if(l==2)
return true;
else
return false;
}
}

import java.util.Scanner;
public class Test21 {
    public static void main(String[] args){
        Scanner in=new Scanner(System.in);
            int q=1;
            int x=in.nextInt();
            while(x--!=1)
                if(isPrime(x)==2)q++;
            System.out.println(q);
    }
    public static int isPrime(int n) {
        int c=0;
        for(int i=2;i<n;i++)
            if(n%i==0)
                if(Prime(i)){
                    c++;
                }
        return c;
    }
    public static boolean Prime(int n){
        for(int i=2;i<n;i++)
            if(n%i==0)return false;
        return true;
    }
}

import java.util.Scanner;

/**
 * @author artyom
 */
public class AlmostPrime2 {
    private static final short MAX_PRIME_NUMBER = 3_000 / 2;
    private static final short[] primes = new short[MAX_PRIME_NUMBER + 1];

    static {
        generatePrimes();
    }

    private static void generatePrimes() {
        for (int i = 2, n = (int) Math.sqrt(MAX_PRIME_NUMBER); i <= n; i++) {
            if (primes[i] == 0) {
                for (int j = 2 * i; j <= MAX_PRIME_NUMBER; j += i) {
                    primes[j]++;
                }
            }
        }
    }

    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        short n = sc.nextShort();
        System.out.println(calcAlmostPrimes(n));
    }

    private static short calcAlmostPrimes(short n) {
        short c = 0;
        for (int i = 2; i <= n; i++) {
            if (primes[i] == 2) {
                c++;
            }
        }
        return c;
    }
}

import java.util.*;
import java.math.*;
public class MyClass {
    public static void main(String args[]) {
        Scanner scan = new Scanner(System.in);
        int ulet = scan.nextInt();
        int result = 0;
        BigInteger prime;
        for(int x = 2 ; x<=ulet; x++){
            int counter = 0;
            for(int y=2; y<x; y++){
               prime = BigInteger.valueOf(y);
                if(prime.isProbablePrime(1)){
                    if(x%y == 0){
                        counter++;
                    }
                }
                if(counter > 2)
                    break;
            }
            if(counter == 2)
                result++;

        }
        System.out.print(result);
    }
}

import java.util.ArrayList;
import java.util.Scanner;

public class AlmostPrime {
	int fact(int n){
		int counter=0;
		ArrayList<Integer>res=new ArrayList<>();
		if(n%2==0) {
			counter++;
			n=n/2;
		}
		while(n%2==0) {
			n=n/2;
		}
		for(int i=3;i*i<=n;i++) {
			if(n%i==0) {
				counter++;
				n=n/i;
			}
			while(n%i==0) {
				n=n/i;
			}
		}
		if(n>1) {
			counter++;
		}
		return counter;
	}
	int almost(int n) {
		int counter=0;
		for(int i=2;i<=n;i++) {
			if(fact(i)>=2) {
				counter++;
			}
		}
		return counter;
	}

	public static void main(String[]args) {

		Scanner scan=new Scanner(System.in);
		int n=scan.nextInt();
		AlmostPrime ob= new AlmostPrime();
		System.out.println(ob.almost(n));
	}
}

import java.util.*;
public class AlmostPrime_26A {

    public static Scanner in = new Scanner(System.in);
    public static int [] primes;
    public static int c = 0; //c is the size of primes

    public static void generatePrimes(int n) { //using sieve
        //0 is prime, 1 isnt
        primes = new int[n];
        int [] sieve = new int [n+1];
        int i = 2;
        while (i < n && sieve[i] == 0) {
            for (int j = i+i; j <= n; j=j+i)
                    sieve[j] = 1;
            i++;
        }
        for(int k = 2; k< sieve.length; k++)
            if (sieve[k] == 0)
                primes[c++] = k;
        for (int y = 0; y< primes.length; y++)
            System.out.print(primes[y] + " ");
        System.out.println();
    }
    public static int notAlmostPrimes(int n) {
        /*int counter = 0;
        for(int i = 1; i <= n; i++) {
            int c = 0;
            for(int j = 0; j < primes.length && primes[j] <= i/2; j++)
                if (n%primes[j]==0)
                    c++;
            if (c >= 2)
                counter = 0;*/
            /*tried generating them
             * for (int i =0; i<primes.length && primes[i]*2 <= n;i++) {
                int [] p = new int [i/2];
                for(int j=i+1; j < primes.length && primes[j]*primes[i] <=n; j++)
                    d++;
            }
            return d;*/
        //doing exculsion--simpler?
        int p = 0;
        for (int i =0; i< primes.length && primes[i] != 0 && primes[i]*2 <= n; i++){
            for (int k=2; Math.pow(primes[i], k) <= n; k++)
                p++;    //ex 2*2 = 4
        }
        p++; //for 1*1
        System.out.println(p +" " + c);
        return p+c;
    }

    public static void main (String[] args) {
        int n = in.nextInt();
        generatePrimes(n);

        System.out.println( n-notAlmostPrimes(n) );
        //n!=1 ||n=2 || n=3?
    }
}

import java.util.*;
public class AlmostPrime {

    static List<Integer> l = new ArrayList<Integer>();

    static void sieve(int n){
        boolean[] prime = new boolean[(n/2) + 1];
        Arrays.fill(prime, true);
        prime[0] = false;
        if(prime.length>1){
            prime[1] = false;
            int m = (int) Math.sqrt(n);
            for (int i = 2; i <= m; i++)
            if (prime[i])
              for (int k = i * i; k <= (n/2); k += i)
                prime[k] = false;
            for(int i=0; i<=n/2; i++) if(prime[i] && (i<=n/2)) l.add(i);
        }
    }

    static void almostPrime(int n){
        int count = 0; boolean end = false;
        for(int k=1; k<=n; k++){
            end = false;
            for(int i=0; i<l.size();i++){
                int a = l.get(i);
                for(int j=i+1; j<l.size();j++){
                    int b = l.get(j);
                    if(((k%a)==0)&&((k%b)==0)) count++;
                    else if((a*b)>k) {
                        end=true;  break;
                    }
                }
                if(end) break;
            }
        }
        System.out.println(count);
    }

    static void solve(){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        sieve(n);
        almostPrime(n);
    }

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

import java.util.*;

public class CF26A{

    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int result = 0;

        Map<Integer, Integer> map = new HashMap<Integer, Integer>();
        List<Integer> list = new ArrayList<Integer>();
        for(int i=2; i<=n; i++){ list.add(i); }
        while(!list.isEmpty()){
            int thisPrime = list.remove(0);
            Integer thisAlmostPrime = map.get(thisPrime);
            if(thisAlmostPrime != null){ result += thisAlmostPrime; }

            for(int i=0; i<list.size();){
                if(list.get(i)%thisPrime == 0){
                    int quot = list.remove(i)/thisPrime;
                    Integer count = map.get(quot);
                    if(count == null){ map.put(quot, 1); }else{ map.put(quot, count+1); }
                }else{ i++; }
            }
        }

        System.out.println(result);
    }
}

import java.util.Scanner;

public class pri {
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt(),l=0;
		for(int i=2;i<=n;i++)
		{
			int u=0;
			for(int h=i-1;h>=2;h--)
			{
				if(i%h==0)
				{
					u=1;
					break;
				}
			}

			if(u==0  && n%i==0)
			{
				l++;
			}
		}

			System.out.println(l);

	}

}

import java.io.PrintWriter;
import java.util.*;

public class Main {
	public static void main(String[] args)
	{
		Scanner in = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);

		List<Integer> primes = getprimes(3000);
		int n = in.nextInt();
		int amount = 0;
		for (int k = 1, counter = 0; k <= n; k++, counter = 0)
		{
			for (int p : primes)
			{
				if(k <= p) break;
				if(k % p == 0) ++counter;
			}
			if(counter == 2) ++amount;
		}

		out.print(amount);
		out.close();
	}

	private static List<Integer> getprimes(int n)
	{
		List<Integer> primes = new ArrayList<Integer>(n);
		primes.add(2);
		boolean[] composite = new boolean[n+1];
		for (int i = 4; i < composite.length; i+=2) composite[i] = true;
		for (int i = 3; i*i <= n; i+=2)
			if(!composite[i])
			{
				primes.add(i);
				for (int j = i*i; j <= n; j+= i) composite[j] = true;
			}
		return primes;
	}
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class AlmostPrime {

	public static void main(String[] args) throws IOException {

		String input;
		int n;
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		input = reader.readLine();
		n = Integer.parseInt(input);

		int N = (int) Math.pow(10, 3);
        int[] Primes = new int[N + 1];

        for (int i = 2; i*i <= N; i++) {

            if (Primes[i] == 0) {
                for (int j = 2; i*j <= N; j++) {
                    Primes[i*j] = Primes[i*j] + 1;
                }
            }
        }

        int j = 0;
        for(int i = 0; i <= n; i++){
        	if(Primes[i] == 2) j++;
        }

        System.out.println(j);

	}

}

import java.io.*;
import java.util.*;
import java.math.*;
public class blaise{
    public static void main(String...args) throws java.lang.Exception{
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    ArrayList<Integer> almost = new ArrayList<Integer>();

    for(int x=1; x<=n; x++){
        if(checker(x)){
            almost.add(x);
            }
     }

    System.out.print(almost.size());

    }

    public static boolean checker(int x){
        int counter = 0;
        BigInteger c;
        ArrayList<Integer> factors = new ArrayList<Integer>();

        for(int i=1; i<=x; i++){
            if(x%i==0){
                factors.add(i);
            }
        }

        for(int i=0; i<=factors.size()-1; i++){
            c  = BigInteger.valueOf(factors.get(i));
            if(c.isProbablePrime(1) && !factors.contains(c))
                counter++;
        }

        if(counter == 2){
            return true;
        }
        return false;

    }
}

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author muhtar
 */
import java.util.*;
public class pochtiProstyieChisla {
    public static void main(String[]args){
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int t = 0;
        int a[] = new int[n+3];
        for(int i=2;i<=n;i++){
            a[i] = 1;
        }
        int s = 0;
        boolean yes = true;
            for(int i=2;i<=n;i++){
                s = i;
                for(int j=2;j<=n;j++){
                    if(i%2==0 && i%j==0 && i%2!=j%2){
                        a[i]++;

                    }
                    else if(i%2!=0 && i%j==0 && i%3!=j%3){
                    a[i]++;

                    }
                }
            }
        for(int i=2;i<=n;i++){
            if(a[i]>=2){
                t++;
            }
        }
        System.out.println(t);
    }
}

import java.util.Scanner;
import java.math.*;

public class Dragon {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);

        int n = scan.nextInt();
        int ctr = 0;
        int out = 0;
        for(int x=2;x<=n;x++) {
            here: for(int y=x/2;y>1;y--) {
                if((x%y)==0 && isPrime(y)) {
                    if(ctr < 2) {
                        ctr++;
                    } else {
                        break here;
                    }
                }
            }
            if(ctr==2)
                out++;
            ctr=0;
        }
        System.out.println(out);
    }

    private static boolean isPrime(int n) {
        for(int x=2;x<=n/2;x++) {
            if(n%x == 0) {
                return false;
            }
        }
        return true;
    }
}

import java.io.*;
import java.util.*;
public class a{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int ct = 0;
		for(int i = 6; i <= n; i++){
			if(ap(i)) ct++;
			System.err.println("[" + i + "]: " + ap(i));
		}
		System.out.println(ct);
	}
	public static boolean ap(int n){
		int f = n;
		int a = 1;
		HashSet<Integer> hs = new HashSet<Integer>();
		while((f&1)==0){
			f >>= 1;
			a <<= 1;
			hs.add(2);
		}

		int end = (int)(Math.sqrt(n)+1);
		for(int d = 3; d < end && a < end; d+=2){
			while(f%d==0){
				f /= d;
				a *= d;
				hs.add(d);
			}
		}
		if(f != n && f != 1){
			hs.add(f);
		}

		return (hs.size() == 2);
	}
}

//e** {{10}}
//e** {{21}}

import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;

public class Solution {

  static int countPrime(int n)
  {
      int count=0;
      for (int i=2; i<=n; i++)
      {

        if (n%i==0)
        {
            boolean b=new BigInteger(Integer.toString(i)).isProbablePrime(1);
            if (b)
            {
                count++;
            }
        }

      }
      return count;
  }
  public static void main(String[] args) {
    Scanner sc=new Scanner(System.in);

    int n=sc.nextInt();

    int count=0;
    for (int i=2; i<=n; i++)
    {
        if (n%i!=0)
        {
            if(countPrime(i)==2)
                count++;
        }
    }
    System.out.println(count);
  }
}

import java.util.*;
public class Main{

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int x = in.nextInt();
        int con = 0;
        for (int i = 6; i <= x; i++) {
            int y = Div(i);
            if (y == 2) {
                con++;
            }
        }
        System.out.println(con);
    }

    public static int Div(int x) {
        ArrayList<Integer> tr = new ArrayList<>();
        boolean primo[] = new boolean[x + 1];
        Arrays.fill(primo, true);
        for (int i = 2; i <= x; i++) {
            if (primo[i] == true) {
                for (int j = i * 2; j <= x; j += i) {
                    primo[j] = false;
                }
                tr.add(i);
            }
        }
        int con = 0;
        for (int j = 0; j < tr.size(); j++) {
            if (x % tr.get(j) == 0) {
                con++;
            }
            if (con == 2) {
                break;
            }

        }
        return con;
    }
}

import java.util.Scanner;

public class P26A {
    int[] primes;
    public P26A() {
        Scanner sc = new Scanner (System.in);
        int n = sc.nextInt();
        sc.close();

        primes = new int[n+1];

        sieve(n, 2);

        int no = 0;
        for (int i = 6; i <= n; i++){
            if (almostPrime(i)){
                no++;
            }
        }

        System.out.println(no);
    }

    void sieve (int n, int p){
        for (int i = 2 * p; i <= n; i += p){
            primes[i] = 1;
        }
        int newP = -1;
        for (int i = p; i <= n; i++){
            if (primes[i] == 0){
                newP = -1;
            }
        }
        if (newP != -1){
            sieve(n, newP);
        }
    }

    boolean almostPrime (int x){
        int div = 0;
        for (int i = 2; i <= x/2; i++){
            if (primes[i] == 0 && x % i == 0){
                div ++;
                if (div == 2){
                    return true;
                }
            }
        }
        return false;
    }

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

import java.util.Scanner;
public class Main{
  static boolean isPrime(long n){
    if(n < 2){
      return false;
    }
    else if(n == 2 || n == 3){
      return true;
    }
    else if(n %2 == 0 || n %3 == 0){
      return false;
    }
    long sqrtN = (long)Math.sqrt(n)+1;
    for(long i = 6L; i <= sqrtN; i += 6){
      if(n%(i-1) == 0 || n%(i+1) == 0){
        return false;
      }
    }
    return true;
  }
  static boolean almostPrime(long n, int tempc){
    long half = n/2;
    for(long i = 2; i <= half; i++){
      if(n %i == 0 && isPrime(i)){
        tempc++;
      }
    }
    if(isPrime(n)){
      tempc++;
    }
    if(tempc == 2){
      return true;
    }
    return false;
  }
  public static void main(String args[]){
    Scanner sc = new Scanner (System.in);
    long num = sc.nextLong();
    int count = 0;
    int tempc = 0;
    for(long i=6; i <= num; i++){
      tempc = 0;
      if(almostPrime(i, tempc)){
        System.out.println("For value of = "+i);
        count++;
      }
    }
    System.out.println(count);
  }
}

import java.io.*;
import java.util.*;

public class Almost_Prime {

	static class FastReader {
		BufferedReader br;
		StringTokenizer st;

		public FastReader() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		String next() {
			while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());
		}

		long nextLong() {
			return Long.parseLong(next());
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}

		String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return str;
		}

	}

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		FastReader t = new FastReader();
		PrintWriter o = new PrintWriter(System.out);
		int n = t.nextInt();
		int k = n;
		ArrayList<Integer> a = SOE(n);
		n = a.size();
		int count = 0;

		for (int i = 0; i < n; i++) {
			for (int j = i + 1; j < n; j++) {
				int num = a.get(i) * a.get(j);

				if (num <= k) {
					int add = num;

					while (num <= k) {
						count++;
						num += add;
					}
				} else
					break;
			}
		}

		o.println(count);

		o.flush();
		o.close();
	}

	private static ArrayList<Integer> SOE(int n) {
		boolean prime[] = new boolean[n + 1];
		ArrayList<Integer> a = new ArrayList<>();

		for (int i = 0; i < n; i++)
			prime[i] = true;

		for (int p = 2; p * p <= n; p++) {
			if (prime[p] == true) {
				for (int i = p * p; i <= n; i += p)
					prime[i] = false;
			}
		}

		for (int i = 2; i <= n; i++) {
			if (prime[i] == true)
				a.add(i);
		}

		return a;
	}
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.StringTokenizer;

import com.sun.javafx.binding.StringFormatter;

public class Main{
	static class MyScanner {
	    BufferedReader br;
	    StringTokenizer st;

	    public MyScanner() {
	       br = new BufferedReader(new InputStreamReader(System.in));
	    }

	    String next() {
	        while (st == null || !st.hasMoreElements()) {
	            try {
	                st = new StringTokenizer(br.readLine());
	            } catch (IOException e) {
	                e.printStackTrace();
	            }
	        }
	        return st.nextToken();
	    }

	    int nextInt() { return Integer.parseInt(next());}

	    long nextLong() {return Long.parseLong(next());}

	    double nextDouble() {return Double.parseDouble(next());}

	    String nextLine(){
	        String str = "";
		  try {
		     str = br.readLine();
		  } catch (IOException e) {
		     e.printStackTrace();
		  }
		  return str;
	    }
	}

		 public static void main(String[] args) throws IOException {
			 	PrintWriter out = new PrintWriter(System.out);
			    MyScanner sc = new MyScanner();
			 	Main solver = new Main();
				solver.solve(out, sc);
				out.flush();
				out.close();

		 }

 		void solve(PrintWriter out, MyScanner sc) throws IOException{
 		//	long s = System.currentTimeMillis();

 				int n = sc.nextInt();
 				int res = 0;
 				for(int i = 1 ; i <= n ; ++i) {
 						int c = 0;
 						int m = i;
 						for(int k = 2 ; k * k <= m ; ++k) {
 							if(m % k == 0) {
 								++c;

 								while(m % k == 0) m /= k;
 							}
 						}
 						if(c == 1 && m > 1) ++res;
 						else if(c == 2) ++res;
 				}

 			out.print(res);

 			//out.print(System.currentTimeMillis() - s);

 		}

}

import java.util.ArrayList;
import java.util.HashSet;
import java.util.Scanner;

public class AlmostPrime {

    public static void main(String args[]) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int[] a = new int[3005];
        ArrayList<Integer> pr = new ArrayList<Integer>();
        for (int i = 2; i < 3005; i++) {
            if (a[i] == 0) {
                pr.add(i);
                for (int j = i * i; j < 3005; j += i) {
                    a[j] = 1;
                }
            }
        }
        int c = 0;
        for (int i = 5; i <= n; i++) {
            int t = i;
            int e = 0;
            for (int j = 0; t >= pr.get(j); j++) {
                if (t % pr.get(j) == 0) {
                    ++e;
                    while (t % i == 0) {
                        t /= pr.get(j);
                    }

                    if (e == 2) {
                        ++c;
                    }

                }

            }

        }
        System.out.println(c);
    }
}

import java.io.*;
import java.util.*;
import java.math.*;
public class blaise{
    public static void main(String...args) throws java.lang.Exception{
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    ArrayList<Integer> almost = new ArrayList<Integer>();

    for(int x=1; x<=n; x++){
        if(checker(x)){
            almost.add(x);
            }
     }
    System.out.print(almost.size());
    }
    public static boolean checker(int x){
        int counter = 0;
        BigInteger c;
        ArrayList<Integer> factors = new ArrayList<Integer>();

        for(int i=1; i<=x; i++){
            if(x%i==0){
                factors.add(i);
            }
        }

        for(int i=0; i<=factors.size()-1; i++){
            c  = BigInteger.valueOf(factors.get(i));
            if(c.isProbablePrime(1) && !factors.contains(c))
                counter++;
        }

        if(counter == 2){
            return true;
        }
        return false;

    }
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;

public class almost{
    static public void main(String[] args) throws IOException {
        BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
        String linea = bf.readLine();
        int n = Integer.parseInt(linea);
        int primos[] = new int[1000+1];
        Arrays.fill(primos,1);
        primos[0] = primos[1] = 1;
        for(int i=2;i<(int) Math.sqrt(3000);i++){
          if(primos[i]==1){
           for(int j=2*i;j<primos.length;j+=i){
                primos[j] = primos[j]+1;
           }
          }
        }

        int i = 3;
        int cont = 0;
        while(i<=n){
            if (primos[i]==3){
                cont ++;
            }
            i++;
        }
        System.out.println(cont);
    }
}