import java.util.Scanner;

public class Main{
    public static void main(String[] args){
	Scanner sc = new Scanner(System.in);
	int N = sc.nextInt();
	int count = 0;
	if(N < 105){
	    count = 0;
	}else if(N ==105){
	    count = 1;
	}else if(N > 105){
	    count = 1;
	    for(int j=107;j<=N;j+=2){
		int cc = 0;
		for(int i=1;i<=j;i+=2){
		    if(j%i==0) cc++;
		}
		if(cc==8) count++;
	    }
	}
	System.out.print(count);
    }
} 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 count = 0;
	if(N < 105){
	    count = 0;
	}else if(N ==105){
	    count = 1;
	}else if(N > 105){
	    count = 1;
	    for(int j=107;j<=N;j+=2){
		int cc = 0;
		for(int i=1;i<=j;i+=2){
		    if(j%i==0) cc++;
		}
		if(cc==8) count++;
	    }
	}
	System.out.print(count);
    }
} Main public static void main(String[] args){
	Scanner sc = new Scanner(System.in);
	int N = sc.nextInt();
	int count = 0;
	if(N < 105){
	    count = 0;
	}else if(N ==105){
	    count = 1;
	}else if(N > 105){
	    count = 1;
	    for(int j=107;j<=N;j+=2){
		int cc = 0;
		for(int i=1;i<=j;i+=2){
		    if(j%i==0) cc++;
		}
		if(cc==8) count++;
	    }
	}
	System.out.print(count);
    } main {
	Scanner sc = new Scanner(System.in);
	int N = sc.nextInt();
	int count = 0;
	if(N < 105){
	    count = 0;
	}else if(N ==105){
	    count = 1;
	}else if(N > 105){
	    count = 1;
	    for(int j=107;j<=N;j+=2){
		int cc = 0;
		for(int i=1;i<=j;i+=2){
		    if(j%i==0) cc++;
		}
		if(cc==8) count++;
	    }
	}
	System.out.print(count);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int count = 0; count 0 if(N < 105){
	    count = 0;
	}else if(N ==105){
	    count = 1;
	}else if(N > 105){
	    count = 1;
	    for(int j=107;j<=N;j+=2){
		int cc = 0;
		for(int i=1;i<=j;i+=2){
		    if(j%i==0) cc++;
		}
		if(cc==8) count++;
	    }
	} N < 105 N 105 {
	    count = 0;
	} count = 0 count 0 if(N ==105){
	    count = 1;
	}else if(N > 105){
	    count = 1;
	    for(int j=107;j<=N;j+=2){
		int cc = 0;
		for(int i=1;i<=j;i+=2){
		    if(j%i==0) cc++;
		}
		if(cc==8) count++;
	    }
	} N ==105 N 105 {
	    count = 1;
	} count = 1 count 1 if(N > 105){
	    count = 1;
	    for(int j=107;j<=N;j+=2){
		int cc = 0;
		for(int i=1;i<=j;i+=2){
		    if(j%i==0) cc++;
		}
		if(cc==8) count++;
	    }
	} N > 105 N 105 {
	    count = 1;
	    for(int j=107;j<=N;j+=2){
		int cc = 0;
		for(int i=1;i<=j;i+=2){
		    if(j%i==0) cc++;
		}
		if(cc==8) count++;
	    }
	} count = 1 count 1 for(int j=107;j<=N;j+=2){
		int cc = 0;
		for(int i=1;i<=j;i+=2){
		    if(j%i==0) cc++;
		}
		if(cc==8) count++;
	    } int j=107; int j=107; j 107 j<=N j N j+=2 j+=2 j 2 {
		int cc = 0;
		for(int i=1;i<=j;i+=2){
		    if(j%i==0) cc++;
		}
		if(cc==8) count++;
	    } {
		int cc = 0;
		for(int i=1;i<=j;i+=2){
		    if(j%i==0) cc++;
		}
		if(cc==8) count++;
	    } int cc = 0; cc 0 for(int i=1;i<=j;i+=2){
		    if(j%i==0) cc++;
		} int i=1; int i=1; i 1 i<=j i j i+=2 i+=2 i 2 {
		    if(j%i==0) cc++;
		} {
		    if(j%i==0) cc++;
		} if(j%i==0) cc++; j%i==0 j%i j i 0 cc++ cc if(cc==8) count++; cc==8 cc 8 count++ count System.out.print(count) System.out.print System.out System System.out count String[] args args public class Main{
    public static void main(String[] args){
	Scanner sc = new Scanner(System.in);
	int N = sc.nextInt();
	int count = 0;
	if(N < 105){
	    count = 0;
	}else if(N ==105){
	    count = 1;
	}else if(N > 105){
	    count = 1;
	    for(int j=107;j<=N;j+=2){
		int cc = 0;
		for(int i=1;i<=j;i+=2){
		    if(j%i==0) cc++;
		}
		if(cc==8) count++;
	    }
	}
	System.out.print(count);
    }
} public class Main{
    public static void main(String[] args){
	Scanner sc = new Scanner(System.in);
	int N = sc.nextInt();
	int count = 0;
	if(N < 105){
	    count = 0;
	}else if(N ==105){
	    count = 1;
	}else if(N > 105){
	    count = 1;
	    for(int j=107;j<=N;j+=2){
		int cc = 0;
		for(int i=1;i<=j;i+=2){
		    if(j%i==0) cc++;
		}
		if(cc==8) count++;
	    }
	}
	System.out.print(count);
    }
} 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 count = 0;
	if(N < 105){
	    count = 0;
	}else if(N ==105){
	    count = 1;
	}else if(N > 105){
	    count = 1;
	    for(int j=107;j<=N;j+=2){
		int cc = 0;
		for(int i=1;i<=j;i+=2){
		    if(j%i==0) cc++;
		}
		if(cc==8) count++;
	    }
	}
	System.out.print(count);
    }
}
