import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		try (Scanner sc = new Scanner(System.in)) {
			int N = sc.nextInt();
			if (N < 105) {
				System.out.print(0);
				return;
			}
			int sum = 1;
			for (int i = 107; i <= N; i += 2) {
				int yakusuu = 2;
				for (int j = 3; j < i; j += 2) {
					if (i % j == 0)
						yakusuu++;
					if (yakusuu > 8)
						break;
				}
				if (yakusuu == 8)
					sum++;
			}
			System.out.print(sum);
		}
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		try (Scanner sc = new Scanner(System.in)) {
			int N = sc.nextInt();
			if (N < 105) {
				System.out.print(0);
				return;
			}
			int sum = 1;
			for (int i = 107; i <= N; i += 2) {
				int yakusuu = 2;
				for (int j = 3; j < i; j += 2) {
					if (i % j == 0)
						yakusuu++;
					if (yakusuu > 8)
						break;
				}
				if (yakusuu == 8)
					sum++;
			}
			System.out.print(sum);
		}
	}
} Main public static void main(String[] args) {
		try (Scanner sc = new Scanner(System.in)) {
			int N = sc.nextInt();
			if (N < 105) {
				System.out.print(0);
				return;
			}
			int sum = 1;
			for (int i = 107; i <= N; i += 2) {
				int yakusuu = 2;
				for (int j = 3; j < i; j += 2) {
					if (i % j == 0)
						yakusuu++;
					if (yakusuu > 8)
						break;
				}
				if (yakusuu == 8)
					sum++;
			}
			System.out.print(sum);
		}
	} main {
		try (Scanner sc = new Scanner(System.in)) {
			int N = sc.nextInt();
			if (N < 105) {
				System.out.print(0);
				return;
			}
			int sum = 1;
			for (int i = 107; i <= N; i += 2) {
				int yakusuu = 2;
				for (int j = 3; j < i; j += 2) {
					if (i % j == 0)
						yakusuu++;
					if (yakusuu > 8)
						break;
				}
				if (yakusuu == 8)
					sum++;
			}
			System.out.print(sum);
		}
	} try (Scanner sc = new Scanner(System.in)) {
			int N = sc.nextInt();
			if (N < 105) {
				System.out.print(0);
				return;
			}
			int sum = 1;
			for (int i = 107; i <= N; i += 2) {
				int yakusuu = 2;
				for (int j = 3; j < i; j += 2) {
					if (i % j == 0)
						yakusuu++;
					if (yakusuu > 8)
						break;
				}
				if (yakusuu == 8)
					sum++;
			}
			System.out.print(sum);
		} {
			int N = sc.nextInt();
			if (N < 105) {
				System.out.print(0);
				return;
			}
			int sum = 1;
			for (int i = 107; i <= N; i += 2) {
				int yakusuu = 2;
				for (int j = 3; j < i; j += 2) {
					if (i % j == 0)
						yakusuu++;
					if (yakusuu > 8)
						break;
				}
				if (yakusuu == 8)
					sum++;
			}
			System.out.print(sum);
		} Scanner sc = new Scanner(System.in) Scanner sc = new Scanner(System.in) new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc if (N < 105) {
				System.out.print(0);
				return;
			} N < 105 N 105 {
				System.out.print(0);
				return;
			} System.out.print(0) System.out.print System.out System System.out 0 return; int sum = 1; sum 1 for (int i = 107; i <= N; i += 2) {
				int yakusuu = 2;
				for (int j = 3; j < i; j += 2) {
					if (i % j == 0)
						yakusuu++;
					if (yakusuu > 8)
						break;
				}
				if (yakusuu == 8)
					sum++;
			} int i = 107; int i = 107; i 107 i <= N i N i += 2 i += 2 i 2 {
				int yakusuu = 2;
				for (int j = 3; j < i; j += 2) {
					if (i % j == 0)
						yakusuu++;
					if (yakusuu > 8)
						break;
				}
				if (yakusuu == 8)
					sum++;
			} {
				int yakusuu = 2;
				for (int j = 3; j < i; j += 2) {
					if (i % j == 0)
						yakusuu++;
					if (yakusuu > 8)
						break;
				}
				if (yakusuu == 8)
					sum++;
			} int yakusuu = 2; yakusuu 2 for (int j = 3; j < i; j += 2) {
					if (i % j == 0)
						yakusuu++;
					if (yakusuu > 8)
						break;
				} int j = 3; int j = 3; j 3 j < i j i j += 2 j += 2 j 2 {
					if (i % j == 0)
						yakusuu++;
					if (yakusuu > 8)
						break;
				} {
					if (i % j == 0)
						yakusuu++;
					if (yakusuu > 8)
						break;
				} if (i % j == 0)
						yakusuu++; i % j == 0 i % j i j 0 yakusuu++ yakusuu if (yakusuu > 8)
						break; yakusuu > 8 yakusuu 8 break; if (yakusuu == 8)
					sum++; yakusuu == 8 yakusuu 8 sum++ sum System.out.print(sum) System.out.print System.out System System.out sum String[] args args public class Main {
	public static void main(String[] args) {
		try (Scanner sc = new Scanner(System.in)) {
			int N = sc.nextInt();
			if (N < 105) {
				System.out.print(0);
				return;
			}
			int sum = 1;
			for (int i = 107; i <= N; i += 2) {
				int yakusuu = 2;
				for (int j = 3; j < i; j += 2) {
					if (i % j == 0)
						yakusuu++;
					if (yakusuu > 8)
						break;
				}
				if (yakusuu == 8)
					sum++;
			}
			System.out.print(sum);
		}
	}
} public class Main {
	public static void main(String[] args) {
		try (Scanner sc = new Scanner(System.in)) {
			int N = sc.nextInt();
			if (N < 105) {
				System.out.print(0);
				return;
			}
			int sum = 1;
			for (int i = 107; i <= N; i += 2) {
				int yakusuu = 2;
				for (int j = 3; j < i; j += 2) {
					if (i % j == 0)
						yakusuu++;
					if (yakusuu > 8)
						break;
				}
				if (yakusuu == 8)
					sum++;
			}
			System.out.print(sum);
		}
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		try (Scanner sc = new Scanner(System.in)) {
			int N = sc.nextInt();
			if (N < 105) {
				System.out.print(0);
				return;
			}
			int sum = 1;
			for (int i = 107; i <= N; i += 2) {
				int yakusuu = 2;
				for (int j = 3; j < i; j += 2) {
					if (i % j == 0)
						yakusuu++;
					if (yakusuu > 8)
						break;
				}
				if (yakusuu == 8)
					sum++;
			}
			System.out.print(sum);
		}
	}
}
