import java.util.Scanner;

class Main {
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt();
		int count = 1;
		
		if (n < 105) {
			System.out.println(0);
			System.exit(0);
		}
		
		int cnt;
		for (int i = 107; i <= n; i+=2) {
			cnt = 2;
			for (int j = 2; j < i; j++) {
				if (i % j == 0) cnt++;
			}
			if (cnt == 8) count++;
		}
		
		System.out.println(count);
	}
} import java.util.Scanner; Scanner java.util class Main {
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt();
		int count = 1;
		
		if (n < 105) {
			System.out.println(0);
			System.exit(0);
		}
		
		int cnt;
		for (int i = 107; i <= n; i+=2) {
			cnt = 2;
			for (int j = 2; j < i; j++) {
				if (i % j == 0) cnt++;
			}
			if (cnt == 8) count++;
		}
		
		System.out.println(count);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt();
		int count = 1;
		
		if (n < 105) {
			System.out.println(0);
			System.exit(0);
		}
		
		int cnt;
		for (int i = 107; i <= n; i+=2) {
			cnt = 2;
			for (int j = 2; j < i; j++) {
				if (i % j == 0) cnt++;
			}
			if (cnt == 8) count++;
		}
		
		System.out.println(count);
	} main {
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt();
		int count = 1;
		
		if (n < 105) {
			System.out.println(0);
			System.exit(0);
		}
		
		int cnt;
		for (int i = 107; i <= n; i+=2) {
			cnt = 2;
			for (int j = 2; j < i; j++) {
				if (i % j == 0) cnt++;
			}
			if (cnt == 8) count++;
		}
		
		System.out.println(count);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int count = 1; count 1 if (n < 105) {
			System.out.println(0);
			System.exit(0);
		} n < 105 n 105 {
			System.out.println(0);
			System.exit(0);
		} System.out.println(0) System.out.println System.out System System.out 0 System.exit(0) System.exit System 0 int cnt; cnt for (int i = 107; i <= n; i+=2) {
			cnt = 2;
			for (int j = 2; j < i; j++) {
				if (i % j == 0) cnt++;
			}
			if (cnt == 8) count++;
		} int i = 107; int i = 107; i 107 i <= n i n i+=2 i+=2 i 2 {
			cnt = 2;
			for (int j = 2; j < i; j++) {
				if (i % j == 0) cnt++;
			}
			if (cnt == 8) count++;
		} {
			cnt = 2;
			for (int j = 2; j < i; j++) {
				if (i % j == 0) cnt++;
			}
			if (cnt == 8) count++;
		} cnt = 2 cnt 2 for (int j = 2; j < i; j++) {
				if (i % j == 0) cnt++;
			} int j = 2; int j = 2; j 2 j < i j i j++ j++ j {
				if (i % j == 0) cnt++;
			} {
				if (i % j == 0) cnt++;
			} if (i % j == 0) cnt++; i % j == 0 i % j i j 0 cnt++ cnt if (cnt == 8) count++; cnt == 8 cnt 8 count++ count System.out.println(count) System.out.println System.out System System.out count String[] args args
import java.util.Scanner;

class Main {
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt();
		int count = 1;
		
		if (n < 105) {
			System.out.println(0);
			System.exit(0);
		}
		
		int cnt;
		for (int i = 107; i <= n; i+=2) {
			cnt = 2;
			for (int j = 2; j < i; j++) {
				if (i % j == 0) cnt++;
			}
			if (cnt == 8) count++;
		}
		
		System.out.println(count);
	}
}