import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		if(N < 105){
        	System.out.println(0);
        	return;
        }
      	int Ncnt = 0;
      	for(int i = 1; i < N+1; i+=2){
          	Integer hN = (int) Math.floor(N/2);
          	int cnt = 2;
        	for(int j = 2; j < hN; j++){
              	if(i%j==0){
                	cnt++;
                }
            }
          	if(cnt==8){
              Ncnt++;
            }
        }
		System.out.println(Ncnt);
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		if(N < 105){
        	System.out.println(0);
        	return;
        }
      	int Ncnt = 0;
      	for(int i = 1; i < N+1; i+=2){
          	Integer hN = (int) Math.floor(N/2);
          	int cnt = 2;
        	for(int j = 2; j < hN; j++){
              	if(i%j==0){
                	cnt++;
                }
            }
          	if(cnt==8){
              Ncnt++;
            }
        }
		System.out.println(Ncnt);
	}
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		if(N < 105){
        	System.out.println(0);
        	return;
        }
      	int Ncnt = 0;
      	for(int i = 1; i < N+1; i+=2){
          	Integer hN = (int) Math.floor(N/2);
          	int cnt = 2;
        	for(int j = 2; j < hN; j++){
              	if(i%j==0){
                	cnt++;
                }
            }
          	if(cnt==8){
              Ncnt++;
            }
        }
		System.out.println(Ncnt);
	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		if(N < 105){
        	System.out.println(0);
        	return;
        }
      	int Ncnt = 0;
      	for(int i = 1; i < N+1; i+=2){
          	Integer hN = (int) Math.floor(N/2);
          	int cnt = 2;
        	for(int j = 2; j < hN; j++){
              	if(i%j==0){
                	cnt++;
                }
            }
          	if(cnt==8){
              Ncnt++;
            }
        }
		System.out.println(Ncnt);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc 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 Ncnt = 0; Ncnt 0 for(int i = 1; i < N+1; i+=2){
          	Integer hN = (int) Math.floor(N/2);
          	int cnt = 2;
        	for(int j = 2; j < hN; j++){
              	if(i%j==0){
                	cnt++;
                }
            }
          	if(cnt==8){
              Ncnt++;
            }
        } int i = 1; int i = 1; i 1 i < N+1 i N+1 N 1 i+=2 i+=2 i 2 {
          	Integer hN = (int) Math.floor(N/2);
          	int cnt = 2;
        	for(int j = 2; j < hN; j++){
              	if(i%j==0){
                	cnt++;
                }
            }
          	if(cnt==8){
              Ncnt++;
            }
        } {
          	Integer hN = (int) Math.floor(N/2);
          	int cnt = 2;
        	for(int j = 2; j < hN; j++){
              	if(i%j==0){
                	cnt++;
                }
            }
          	if(cnt==8){
              Ncnt++;
            }
        } Integer hN = (int) Math.floor(N/2); hN (int) Math.floor(N/2) Math.floor Math N/2 N 2 int cnt = 2; cnt 2 for(int j = 2; j < hN; j++){
              	if(i%j==0){
                	cnt++;
                }
            } int j = 2; int j = 2; j 2 j < hN j hN 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++ cnt if(cnt==8){
              Ncnt++;
            } cnt==8 cnt 8 {
              Ncnt++;
            } Ncnt++ Ncnt System.out.println(Ncnt) System.out.println System.out System System.out Ncnt String[] args args public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		if(N < 105){
        	System.out.println(0);
        	return;
        }
      	int Ncnt = 0;
      	for(int i = 1; i < N+1; i+=2){
          	Integer hN = (int) Math.floor(N/2);
          	int cnt = 2;
        	for(int j = 2; j < hN; j++){
              	if(i%j==0){
                	cnt++;
                }
            }
          	if(cnt==8){
              Ncnt++;
            }
        }
		System.out.println(Ncnt);
	}
} public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		if(N < 105){
        	System.out.println(0);
        	return;
        }
      	int Ncnt = 0;
      	for(int i = 1; i < N+1; i+=2){
          	Integer hN = (int) Math.floor(N/2);
          	int cnt = 2;
        	for(int j = 2; j < hN; j++){
              	if(i%j==0){
                	cnt++;
                }
            }
          	if(cnt==8){
              Ncnt++;
            }
        }
		System.out.println(Ncnt);
	}
} Main
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		if(N < 105){
        	System.out.println(0);
        	return;
        }
      	int Ncnt = 0;
      	for(int i = 1; i < N+1; i+=2){
          	Integer hN = (int) Math.floor(N/2);
          	int cnt = 2;
        	for(int j = 2; j < hN; j++){
              	if(i%j==0){
                	cnt++;
                }
            }
          	if(cnt==8){
              Ncnt++;
            }
        }
		System.out.println(Ncnt);
	}
}
