import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int N = scanner.nextInt();
		
		if (N < 105) {
			System.out.println(0);
			return;
		}
		int count = 0;
		int sum = 1;
		
		for (int j = 106; j <= N; j++) {
			if (j % 2 == 0) {
				continue;
			}
			for (int i = 1; i <= j; i++) {
				if (j % i == 0) {
					count++;
				}
			}
			
//			System.out.println(count);
			if (count == 8) {
				sum++;
			}
			count = 0;
		}
		
		System.out.println(sum);
		scanner.close();
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int N = scanner.nextInt();
		
		if (N < 105) {
			System.out.println(0);
			return;
		}
		int count = 0;
		int sum = 1;
		
		for (int j = 106; j <= N; j++) {
			if (j % 2 == 0) {
				continue;
			}
			for (int i = 1; i <= j; i++) {
				if (j % i == 0) {
					count++;
				}
			}
			
//			System.out.println(count);
			if (count == 8) {
				sum++;
			}
			count = 0;
		}
		
		System.out.println(sum);
		scanner.close();
	}
} Main public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int N = scanner.nextInt();
		
		if (N < 105) {
			System.out.println(0);
			return;
		}
		int count = 0;
		int sum = 1;
		
		for (int j = 106; j <= N; j++) {
			if (j % 2 == 0) {
				continue;
			}
			for (int i = 1; i <= j; i++) {
				if (j % i == 0) {
					count++;
				}
			}
			
//			System.out.println(count);
			if (count == 8) {
				sum++;
			}
			count = 0;
		}
		
		System.out.println(sum);
		scanner.close();
	} main {
		Scanner scanner = new Scanner(System.in);
		int N = scanner.nextInt();
		
		if (N < 105) {
			System.out.println(0);
			return;
		}
		int count = 0;
		int sum = 1;
		
		for (int j = 106; j <= N; j++) {
			if (j % 2 == 0) {
				continue;
			}
			for (int i = 1; i <= j; i++) {
				if (j % i == 0) {
					count++;
				}
			}
			
//			System.out.println(count);
			if (count == 8) {
				sum++;
			}
			count = 0;
		}
		
		System.out.println(sum);
		scanner.close();
	} Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int N = scanner.nextInt(); N scanner.nextInt() scanner.nextInt scanner if (N < 105) {
			System.out.println(0);
			return;
		} N < 105 N 105 {
			System.out.println(0);
			return;
		} System.out.println(0) System.out.println System.out System System.out 0 return; int count = 0; count 0 int sum = 1; sum 1 for (int j = 106; j <= N; j++) {
			if (j % 2 == 0) {
				continue;
			}
			for (int i = 1; i <= j; i++) {
				if (j % i == 0) {
					count++;
				}
			}
			
//			System.out.println(count);
			if (count == 8) {
				sum++;
			}
			count = 0;
		} int j = 106; int j = 106; j 106 j <= N j N j++ j++ j {
			if (j % 2 == 0) {
				continue;
			}
			for (int i = 1; i <= j; i++) {
				if (j % i == 0) {
					count++;
				}
			}
			
//			System.out.println(count);
			if (count == 8) {
				sum++;
			}
			count = 0;
		} {
			if (j % 2 == 0) {
				continue;
			}
			for (int i = 1; i <= j; i++) {
				if (j % i == 0) {
					count++;
				}
			}
			
//			System.out.println(count);
			if (count == 8) {
				sum++;
			}
			count = 0;
		} if (j % 2 == 0) {
				continue;
			} j % 2 == 0 j % 2 j 2 0 {
				continue;
			} continue; for (int i = 1; i <= j; i++) {
				if (j % i == 0) {
					count++;
				}
			} int i = 1; int i = 1; i 1 i <= j i j i++ i++ i {
				if (j % i == 0) {
					count++;
				}
			} {
				if (j % i == 0) {
					count++;
				}
			} if (j % i == 0) {
					count++;
				} j % i == 0 j % i j i 0 {
					count++;
				} count++ count if (count == 8) {
				sum++;
			} count == 8 count 8 {
				sum++;
			} sum++ sum count = 0 count 0 System.out.println(sum) System.out.println System.out System System.out sum scanner.close() scanner.close scanner String[] args args public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int N = scanner.nextInt();
		
		if (N < 105) {
			System.out.println(0);
			return;
		}
		int count = 0;
		int sum = 1;
		
		for (int j = 106; j <= N; j++) {
			if (j % 2 == 0) {
				continue;
			}
			for (int i = 1; i <= j; i++) {
				if (j % i == 0) {
					count++;
				}
			}
			
//			System.out.println(count);
			if (count == 8) {
				sum++;
			}
			count = 0;
		}
		
		System.out.println(sum);
		scanner.close();
	}
} public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int N = scanner.nextInt();
		
		if (N < 105) {
			System.out.println(0);
			return;
		}
		int count = 0;
		int sum = 1;
		
		for (int j = 106; j <= N; j++) {
			if (j % 2 == 0) {
				continue;
			}
			for (int i = 1; i <= j; i++) {
				if (j % i == 0) {
					count++;
				}
			}
			
//			System.out.println(count);
			if (count == 8) {
				sum++;
			}
			count = 0;
		}
		
		System.out.println(sum);
		scanner.close();
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int N = scanner.nextInt();
		
		if (N < 105) {
			System.out.println(0);
			return;
		}
		int count = 0;
		int sum = 1;
		
		for (int j = 106; j <= N; j++) {
			if (j % 2 == 0) {
				continue;
			}
			for (int i = 1; i <= j; i++) {
				if (j % i == 0) {
					count++;
				}
			}
			
//			System.out.println(count);
			if (count == 8) {
				sum++;
			}
			count = 0;
		}
		
		System.out.println(sum);
		scanner.close();
	}
}