import java.util.*;

public class Main {
	static int get(int a) {
		int b = 2;
		for(int i = 3;i <= a / 3;i += 2) {
			if(a % i == 0) {
				b ++;
			}
		}
		return b;
	}
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int a = in.nextInt();
		int m = 0;
		if(a >= 105)m ++;
		for(int i = 107;i <= a;i += 2) {
			if(get(i) == 8)m ++;
		}
		System.out.println(m);
	}
} import java.util.*; util.* java public class Main {
	static int get(int a) {
		int b = 2;
		for(int i = 3;i <= a / 3;i += 2) {
			if(a % i == 0) {
				b ++;
			}
		}
		return b;
	}
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int a = in.nextInt();
		int m = 0;
		if(a >= 105)m ++;
		for(int i = 107;i <= a;i += 2) {
			if(get(i) == 8)m ++;
		}
		System.out.println(m);
	}
} Main static int get(int a) {
		int b = 2;
		for(int i = 3;i <= a / 3;i += 2) {
			if(a % i == 0) {
				b ++;
			}
		}
		return b;
	} get {
		int b = 2;
		for(int i = 3;i <= a / 3;i += 2) {
			if(a % i == 0) {
				b ++;
			}
		}
		return b;
	} int b = 2; b 2 for(int i = 3;i <= a / 3;i += 2) {
			if(a % i == 0) {
				b ++;
			}
		} int i = 3; int i = 3; i 3 i <= a / 3 i a / 3 a 3 i += 2 i += 2 i 2 {
			if(a % i == 0) {
				b ++;
			}
		} {
			if(a % i == 0) {
				b ++;
			}
		} if(a % i == 0) {
				b ++;
			} a % i == 0 a % i a i 0 {
				b ++;
			} b ++ b return b; b int a a public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int a = in.nextInt();
		int m = 0;
		if(a >= 105)m ++;
		for(int i = 107;i <= a;i += 2) {
			if(get(i) == 8)m ++;
		}
		System.out.println(m);
	} main {
		Scanner in = new Scanner(System.in);
		int a = in.nextInt();
		int m = 0;
		if(a >= 105)m ++;
		for(int i = 107;i <= a;i += 2) {
			if(get(i) == 8)m ++;
		}
		System.out.println(m);
	} Scanner in = new Scanner(System.in); in new Scanner(System.in) int a = in.nextInt(); a in.nextInt() in.nextInt in int m = 0; m 0 if(a >= 105)m ++; a >= 105 a 105 m ++ m for(int i = 107;i <= a;i += 2) {
			if(get(i) == 8)m ++;
		} int i = 107; int i = 107; i 107 i <= a i a i += 2 i += 2 i 2 {
			if(get(i) == 8)m ++;
		} {
			if(get(i) == 8)m ++;
		} if(get(i) == 8)m ++; get(i) == 8 get(i) get i 8 m ++ m System.out.println(m) System.out.println System.out System System.out m String[] args args public class Main {
	static int get(int a) {
		int b = 2;
		for(int i = 3;i <= a / 3;i += 2) {
			if(a % i == 0) {
				b ++;
			}
		}
		return b;
	}
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int a = in.nextInt();
		int m = 0;
		if(a >= 105)m ++;
		for(int i = 107;i <= a;i += 2) {
			if(get(i) == 8)m ++;
		}
		System.out.println(m);
	}
} public class Main {
	static int get(int a) {
		int b = 2;
		for(int i = 3;i <= a / 3;i += 2) {
			if(a % i == 0) {
				b ++;
			}
		}
		return b;
	}
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int a = in.nextInt();
		int m = 0;
		if(a >= 105)m ++;
		for(int i = 107;i <= a;i += 2) {
			if(get(i) == 8)m ++;
		}
		System.out.println(m);
	}
} Main
import java.util.*;

public class Main {
	static int get(int a) {
		int b = 2;
		for(int i = 3;i <= a / 3;i += 2) {
			if(a % i == 0) {
				b ++;
			}
		}
		return b;
	}
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int a = in.nextInt();
		int m = 0;
		if(a >= 105)m ++;
		for(int i = 107;i <= a;i += 2) {
			if(get(i) == 8)m ++;
		}
		System.out.println(m);
	}
}
