import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner((System.in));
		int n = sc.nextInt();
		int ans = 0;
		
		if (n < 105) {
			ans = 0;
		} else if (n < 107) {
			ans = 1;
		} else {
			ans++;
			for (int i = 107; i <= n; i++) {
				if (i % 2 == 0) {
					continue;
				}
				int div = 1;
				int sum = 0;
				while (div <= i) {
					if (i % div == 0) {
						sum++;
					}
					div++;
				}
				if (sum == 8) {
					ans++;
				}
			}
		}

		System.out.println(ans);

		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();
		int ans = 0;
		
		if (n < 105) {
			ans = 0;
		} else if (n < 107) {
			ans = 1;
		} else {
			ans++;
			for (int i = 107; i <= n; i++) {
				if (i % 2 == 0) {
					continue;
				}
				int div = 1;
				int sum = 0;
				while (div <= i) {
					if (i % div == 0) {
						sum++;
					}
					div++;
				}
				if (sum == 8) {
					ans++;
				}
			}
		}

		System.out.println(ans);

		sc.close();
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner((System.in));
		int n = sc.nextInt();
		int ans = 0;
		
		if (n < 105) {
			ans = 0;
		} else if (n < 107) {
			ans = 1;
		} else {
			ans++;
			for (int i = 107; i <= n; i++) {
				if (i % 2 == 0) {
					continue;
				}
				int div = 1;
				int sum = 0;
				while (div <= i) {
					if (i % div == 0) {
						sum++;
					}
					div++;
				}
				if (sum == 8) {
					ans++;
				}
			}
		}

		System.out.println(ans);

		sc.close();
	} main {
		Scanner sc = new Scanner((System.in));
		int n = sc.nextInt();
		int ans = 0;
		
		if (n < 105) {
			ans = 0;
		} else if (n < 107) {
			ans = 1;
		} else {
			ans++;
			for (int i = 107; i <= n; i++) {
				if (i % 2 == 0) {
					continue;
				}
				int div = 1;
				int sum = 0;
				while (div <= i) {
					if (i % div == 0) {
						sum++;
					}
					div++;
				}
				if (sum == 8) {
					ans++;
				}
			}
		}

		System.out.println(ans);

		sc.close();
	} Scanner sc = new Scanner((System.in)); sc new Scanner((System.in)) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int ans = 0; ans 0 if (n < 105) {
			ans = 0;
		} else if (n < 107) {
			ans = 1;
		} else {
			ans++;
			for (int i = 107; i <= n; i++) {
				if (i % 2 == 0) {
					continue;
				}
				int div = 1;
				int sum = 0;
				while (div <= i) {
					if (i % div == 0) {
						sum++;
					}
					div++;
				}
				if (sum == 8) {
					ans++;
				}
			}
		} n < 105 n 105 {
			ans = 0;
		} ans = 0 ans 0 if (n < 107) {
			ans = 1;
		} else {
			ans++;
			for (int i = 107; i <= n; i++) {
				if (i % 2 == 0) {
					continue;
				}
				int div = 1;
				int sum = 0;
				while (div <= i) {
					if (i % div == 0) {
						sum++;
					}
					div++;
				}
				if (sum == 8) {
					ans++;
				}
			}
		} n < 107 n 107 {
			ans = 1;
		} ans = 1 ans 1 {
			ans++;
			for (int i = 107; i <= n; i++) {
				if (i % 2 == 0) {
					continue;
				}
				int div = 1;
				int sum = 0;
				while (div <= i) {
					if (i % div == 0) {
						sum++;
					}
					div++;
				}
				if (sum == 8) {
					ans++;
				}
			}
		} ans++ ans for (int i = 107; i <= n; i++) {
				if (i % 2 == 0) {
					continue;
				}
				int div = 1;
				int sum = 0;
				while (div <= i) {
					if (i % div == 0) {
						sum++;
					}
					div++;
				}
				if (sum == 8) {
					ans++;
				}
			} int i = 107; int i = 107; i 107 i <= n i n i++ i++ i {
				if (i % 2 == 0) {
					continue;
				}
				int div = 1;
				int sum = 0;
				while (div <= i) {
					if (i % div == 0) {
						sum++;
					}
					div++;
				}
				if (sum == 8) {
					ans++;
				}
			} {
				if (i % 2 == 0) {
					continue;
				}
				int div = 1;
				int sum = 0;
				while (div <= i) {
					if (i % div == 0) {
						sum++;
					}
					div++;
				}
				if (sum == 8) {
					ans++;
				}
			} if (i % 2 == 0) {
					continue;
				} i % 2 == 0 i % 2 i 2 0 {
					continue;
				} continue; int div = 1; div 1 int sum = 0; sum 0 while (div <= i) {
					if (i % div == 0) {
						sum++;
					}
					div++;
				} div <= i div i {
					if (i % div == 0) {
						sum++;
					}
					div++;
				} if (i % div == 0) {
						sum++;
					} i % div == 0 i % div i div 0 {
						sum++;
					} sum++ sum div++ div if (sum == 8) {
					ans++;
				} sum == 8 sum 8 {
					ans++;
				} ans++ ans System.out.println(ans) System.out.println System.out System System.out ans 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();
		int ans = 0;
		
		if (n < 105) {
			ans = 0;
		} else if (n < 107) {
			ans = 1;
		} else {
			ans++;
			for (int i = 107; i <= n; i++) {
				if (i % 2 == 0) {
					continue;
				}
				int div = 1;
				int sum = 0;
				while (div <= i) {
					if (i % div == 0) {
						sum++;
					}
					div++;
				}
				if (sum == 8) {
					ans++;
				}
			}
		}

		System.out.println(ans);

		sc.close();
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner((System.in));
		int n = sc.nextInt();
		int ans = 0;
		
		if (n < 105) {
			ans = 0;
		} else if (n < 107) {
			ans = 1;
		} else {
			ans++;
			for (int i = 107; i <= n; i++) {
				if (i % 2 == 0) {
					continue;
				}
				int div = 1;
				int sum = 0;
				while (div <= i) {
					if (i % div == 0) {
						sum++;
					}
					div++;
				}
				if (sum == 8) {
					ans++;
				}
			}
		}

		System.out.println(ans);

		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();
		int ans = 0;
		
		if (n < 105) {
			ans = 0;
		} else if (n < 107) {
			ans = 1;
		} else {
			ans++;
			for (int i = 107; i <= n; i++) {
				if (i % 2 == 0) {
					continue;
				}
				int div = 1;
				int sum = 0;
				while (div <= i) {
					if (i % div == 0) {
						sum++;
					}
					div++;
				}
				if (sum == 8) {
					ans++;
				}
			}
		}

		System.out.println(ans);

		sc.close();
	}
}
