import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;

public class bertrand_ft implements Runnable {

	private Scanner in;
	private PrintWriter out;
	private int cread = 0;

	private boolean isPrime(int n) {
		for (int i = 2; i <= Math.min(n - 1, Math.round(Math.sqrt(n)) + 1); i++) {
			if (n % i == 0) return false;
		}
		return true;
	}	
	
	public void run() {
		int n = in.nextInt();
		int ans = 0;
		for (int i = n + 1; i < 2 * n; i++) {
			if (isPrime(i)) ans++;
		} 
		out.println(ans);
		out.close();
	}
	
	private bertrand_ft(String name) {
		try {
			in = new Scanner(new File(name + ".in"));
			out = new PrintWriter(new FileWriter(name + ".out"));	
		} catch (IOException e) {
			e.printStackTrace();
			System.exit(239);
		}
	}

	public static void main(String[] args) {
		(new Thread(new bertrand_ft("b"))).start();
	}
}
