import java.io.*;
class Main {
 public static void main(String[] args) throws IOException{
	try ( BufferedReader br = new BufferedReader(new InputStreamReader(System.in)) ){
		final int target = Integer.parseInt( br.readLine() );
		int counter = 0;

		for( int i = 3; i <= target; i+=2 ){
			int tmpCnt = 0;
			for( int j = 1 ; j <= i ; j+=2 ){
				if( i%j == 0 ){
					tmpCnt++;	
				}
			}
//			System.out.println(i + ", " +tmpCnt);
			if( tmpCnt == 8 ){
				counter++;
			}
		}

		System.out.println(counter);

	}


 }
} import java.io.*; io.* java class Main {
 public static void main(String[] args) throws IOException{
	try ( BufferedReader br = new BufferedReader(new InputStreamReader(System.in)) ){
		final int target = Integer.parseInt( br.readLine() );
		int counter = 0;

		for( int i = 3; i <= target; i+=2 ){
			int tmpCnt = 0;
			for( int j = 1 ; j <= i ; j+=2 ){
				if( i%j == 0 ){
					tmpCnt++;	
				}
			}
//			System.out.println(i + ", " +tmpCnt);
			if( tmpCnt == 8 ){
				counter++;
			}
		}

		System.out.println(counter);

	}


 }
} Main public static void main(String[] args) throws IOException{
	try ( BufferedReader br = new BufferedReader(new InputStreamReader(System.in)) ){
		final int target = Integer.parseInt( br.readLine() );
		int counter = 0;

		for( int i = 3; i <= target; i+=2 ){
			int tmpCnt = 0;
			for( int j = 1 ; j <= i ; j+=2 ){
				if( i%j == 0 ){
					tmpCnt++;	
				}
			}
//			System.out.println(i + ", " +tmpCnt);
			if( tmpCnt == 8 ){
				counter++;
			}
		}

		System.out.println(counter);

	}


 } main {
	try ( BufferedReader br = new BufferedReader(new InputStreamReader(System.in)) ){
		final int target = Integer.parseInt( br.readLine() );
		int counter = 0;

		for( int i = 3; i <= target; i+=2 ){
			int tmpCnt = 0;
			for( int j = 1 ; j <= i ; j+=2 ){
				if( i%j == 0 ){
					tmpCnt++;	
				}
			}
//			System.out.println(i + ", " +tmpCnt);
			if( tmpCnt == 8 ){
				counter++;
			}
		}

		System.out.println(counter);

	}


 } try ( BufferedReader br = new BufferedReader(new InputStreamReader(System.in)) ){
		final int target = Integer.parseInt( br.readLine() );
		int counter = 0;

		for( int i = 3; i <= target; i+=2 ){
			int tmpCnt = 0;
			for( int j = 1 ; j <= i ; j+=2 ){
				if( i%j == 0 ){
					tmpCnt++;	
				}
			}
//			System.out.println(i + ", " +tmpCnt);
			if( tmpCnt == 8 ){
				counter++;
			}
		}

		System.out.println(counter);

	} {
		final int target = Integer.parseInt( br.readLine() );
		int counter = 0;

		for( int i = 3; i <= target; i+=2 ){
			int tmpCnt = 0;
			for( int j = 1 ; j <= i ; j+=2 ){
				if( i%j == 0 ){
					tmpCnt++;	
				}
			}
//			System.out.println(i + ", " +tmpCnt);
			if( tmpCnt == 8 ){
				counter++;
			}
		}

		System.out.println(counter);

	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)) BufferedReader br = new BufferedReader(new InputStreamReader(System.in)) new BufferedReader(new InputStreamReader(System.in)) final int target = Integer.parseInt( br.readLine() ); target Integer.parseInt( br.readLine() ) Integer.parseInt Integer br.readLine() br.readLine br int counter = 0; counter 0 for( int i = 3; i <= target; i+=2 ){
			int tmpCnt = 0;
			for( int j = 1 ; j <= i ; j+=2 ){
				if( i%j == 0 ){
					tmpCnt++;	
				}
			}
//			System.out.println(i + ", " +tmpCnt);
			if( tmpCnt == 8 ){
				counter++;
			}
		} int i = 3; int i = 3; i 3 i <= target i target i+=2 i+=2 i 2 {
			int tmpCnt = 0;
			for( int j = 1 ; j <= i ; j+=2 ){
				if( i%j == 0 ){
					tmpCnt++;	
				}
			}
//			System.out.println(i + ", " +tmpCnt);
			if( tmpCnt == 8 ){
				counter++;
			}
		} {
			int tmpCnt = 0;
			for( int j = 1 ; j <= i ; j+=2 ){
				if( i%j == 0 ){
					tmpCnt++;	
				}
			}
//			System.out.println(i + ", " +tmpCnt);
			if( tmpCnt == 8 ){
				counter++;
			}
		} int tmpCnt = 0; tmpCnt 0 for( int j = 1 ; j <= i ; j+=2 ){
				if( i%j == 0 ){
					tmpCnt++;	
				}
			} int j = 1 ; int j = 1 ; j 1 j <= i j i j+=2 j+=2 j 2 {
				if( i%j == 0 ){
					tmpCnt++;	
				}
			} {
				if( i%j == 0 ){
					tmpCnt++;	
				}
			} if( i%j == 0 ){
					tmpCnt++;	
				} i%j == 0 i%j i j 0 {
					tmpCnt++;	
				} tmpCnt++ tmpCnt if( tmpCnt == 8 ){
				counter++;
			} tmpCnt == 8 tmpCnt 8 {
				counter++;
			} counter++ counter System.out.println(counter) System.out.println System.out System System.out counter String[] args args
import java.io.*;
class Main {
 public static void main(String[] args) throws IOException{
	try ( BufferedReader br = new BufferedReader(new InputStreamReader(System.in)) ){
		final int target = Integer.parseInt( br.readLine() );
		int counter = 0;

		for( int i = 3; i <= target; i+=2 ){
			int tmpCnt = 0;
			for( int j = 1 ; j <= i ; j+=2 ){
				if( i%j == 0 ){
					tmpCnt++;	
				}
			}
//			System.out.println(i + ", " +tmpCnt);
			if( tmpCnt == 8 ){
				counter++;
			}
		}

		System.out.println(counter);

	}


 }
}