import java.util.*;
import java.lang.*;
class Main{
    public static int p(int n){
        int count = 0;
        for(int i = 1; i < (int) Math.sqrt(n)+1; i++){
            if(n%i==0)count+=2;
        }
        return count;
    }
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int N = scan.nextInt();
        int count = 0;
        for(int i = 105; i <= N; i+= 2){
            if(p(i) == 8)count++;
        }
        System.out.println(count);

    }
} import java.util.*; util.* java import java.lang.*; lang.* java class Main{
    public static int p(int n){
        int count = 0;
        for(int i = 1; i < (int) Math.sqrt(n)+1; i++){
            if(n%i==0)count+=2;
        }
        return count;
    }
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int N = scan.nextInt();
        int count = 0;
        for(int i = 105; i <= N; i+= 2){
            if(p(i) == 8)count++;
        }
        System.out.println(count);

    }
} Main public static int p(int n){
        int count = 0;
        for(int i = 1; i < (int) Math.sqrt(n)+1; i++){
            if(n%i==0)count+=2;
        }
        return count;
    } p {
        int count = 0;
        for(int i = 1; i < (int) Math.sqrt(n)+1; i++){
            if(n%i==0)count+=2;
        }
        return count;
    } int count = 0; count 0 for(int i = 1; i < (int) Math.sqrt(n)+1; i++){
            if(n%i==0)count+=2;
        } int i = 1; int i = 1; i 1 i < (int) Math.sqrt(n)+1 i (int) Math.sqrt(n)+1 (int) Math.sqrt(n) Math.sqrt Math n 1 i++ i++ i {
            if(n%i==0)count+=2;
        } {
            if(n%i==0)count+=2;
        } if(n%i==0)count+=2; n%i==0 n%i n i 0 count+=2 count 2 return count; count int n n public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int N = scan.nextInt();
        int count = 0;
        for(int i = 105; i <= N; i+= 2){
            if(p(i) == 8)count++;
        }
        System.out.println(count);

    } main {
        Scanner scan = new Scanner(System.in);
        int N = scan.nextInt();
        int count = 0;
        for(int i = 105; i <= N; i+= 2){
            if(p(i) == 8)count++;
        }
        System.out.println(count);

    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int N = scan.nextInt(); N scan.nextInt() scan.nextInt scan int count = 0; count 0 for(int i = 105; i <= N; i+= 2){
            if(p(i) == 8)count++;
        } int i = 105; int i = 105; i 105 i <= N i N i+= 2 i+= 2 i 2 {
            if(p(i) == 8)count++;
        } {
            if(p(i) == 8)count++;
        } if(p(i) == 8)count++; p(i) == 8 p(i) p i 8 count++ count System.out.println(count) System.out.println System.out System System.out count String[] args args
import java.util.*;
import java.lang.*;
class Main{
    public static int p(int n){
        int count = 0;
        for(int i = 1; i < (int) Math.sqrt(n)+1; i++){
            if(n%i==0)count+=2;
        }
        return count;
    }
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int N = scan.nextInt();
        int count = 0;
        for(int i = 105; i <= N; i+= 2){
            if(p(i) == 8)count++;
        }
        System.out.println(count);

    }
}
