import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		
		if (N<105)
			System.out.println(0);
		
		else if (N<135)
			System.out.println(1);
		
		else if (N<165)
			System.out.println(2);
		
		else if (N<189)
			System.out.println(3);
		
		else if (N<195)
			System.out.println(4);
		
		else 
			System.out.println(5);
		
		sc.close();
	}

} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		
		if (N<105)
			System.out.println(0);
		
		else if (N<135)
			System.out.println(1);
		
		else if (N<165)
			System.out.println(2);
		
		else if (N<189)
			System.out.println(3);
		
		else if (N<195)
			System.out.println(4);
		
		else 
			System.out.println(5);
		
		sc.close();
	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		
		if (N<105)
			System.out.println(0);
		
		else if (N<135)
			System.out.println(1);
		
		else if (N<165)
			System.out.println(2);
		
		else if (N<189)
			System.out.println(3);
		
		else if (N<195)
			System.out.println(4);
		
		else 
			System.out.println(5);
		
		sc.close();
	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		
		if (N<105)
			System.out.println(0);
		
		else if (N<135)
			System.out.println(1);
		
		else if (N<165)
			System.out.println(2);
		
		else if (N<189)
			System.out.println(3);
		
		else if (N<195)
			System.out.println(4);
		
		else 
			System.out.println(5);
		
		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc if (N<105)
			System.out.println(0);
		
		else if (N<135)
			System.out.println(1);
		
		else if (N<165)
			System.out.println(2);
		
		else if (N<189)
			System.out.println(3);
		
		else if (N<195)
			System.out.println(4);
		
		else 
			System.out.println(5); N<105 N 105 System.out.println(0) System.out.println System.out System System.out 0 if (N<135)
			System.out.println(1);
		
		else if (N<165)
			System.out.println(2);
		
		else if (N<189)
			System.out.println(3);
		
		else if (N<195)
			System.out.println(4);
		
		else 
			System.out.println(5); N<135 N 135 System.out.println(1) System.out.println System.out System System.out 1 if (N<165)
			System.out.println(2);
		
		else if (N<189)
			System.out.println(3);
		
		else if (N<195)
			System.out.println(4);
		
		else 
			System.out.println(5); N<165 N 165 System.out.println(2) System.out.println System.out System System.out 2 if (N<189)
			System.out.println(3);
		
		else if (N<195)
			System.out.println(4);
		
		else 
			System.out.println(5); N<189 N 189 System.out.println(3) System.out.println System.out System System.out 3 if (N<195)
			System.out.println(4);
		
		else 
			System.out.println(5); N<195 N 195 System.out.println(4) System.out.println System.out System System.out 4 System.out.println(5) System.out.println System.out System System.out 5 sc.close() sc.close sc String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		
		if (N<105)
			System.out.println(0);
		
		else if (N<135)
			System.out.println(1);
		
		else if (N<165)
			System.out.println(2);
		
		else if (N<189)
			System.out.println(3);
		
		else if (N<195)
			System.out.println(4);
		
		else 
			System.out.println(5);
		
		sc.close();
	}

} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		
		if (N<105)
			System.out.println(0);
		
		else if (N<135)
			System.out.println(1);
		
		else if (N<165)
			System.out.println(2);
		
		else if (N<189)
			System.out.println(3);
		
		else if (N<195)
			System.out.println(4);
		
		else 
			System.out.println(5);
		
		sc.close();
	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		
		if (N<105)
			System.out.println(0);
		
		else if (N<135)
			System.out.println(1);
		
		else if (N<165)
			System.out.println(2);
		
		else if (N<189)
			System.out.println(3);
		
		else if (N<195)
			System.out.println(4);
		
		else 
			System.out.println(5);
		
		sc.close();
	}

}
