import java.util.Scanner;
class Main{
    public static void main(String arg[]){
        Scanner scn=new Scanner(System.in);
        int n = scn.nextInt();
        int answer=1;
        if(n<105){
            System.out.println(0);
        }else{
            for(int i= 107;i<=n;i+=2){
                int cnt=0;
                for(int j=1;j<=i;j+=2){
                    if(i%j==0){
                        cnt++;
                    }
                }
                if(cnt==8) answer++;
            }
            System.out.println(answer);
        }
    }
} import java.util.Scanner; Scanner java.util class Main{
    public static void main(String arg[]){
        Scanner scn=new Scanner(System.in);
        int n = scn.nextInt();
        int answer=1;
        if(n<105){
            System.out.println(0);
        }else{
            for(int i= 107;i<=n;i+=2){
                int cnt=0;
                for(int j=1;j<=i;j+=2){
                    if(i%j==0){
                        cnt++;
                    }
                }
                if(cnt==8) answer++;
            }
            System.out.println(answer);
        }
    }
} Main public static void main(String arg[]){
        Scanner scn=new Scanner(System.in);
        int n = scn.nextInt();
        int answer=1;
        if(n<105){
            System.out.println(0);
        }else{
            for(int i= 107;i<=n;i+=2){
                int cnt=0;
                for(int j=1;j<=i;j+=2){
                    if(i%j==0){
                        cnt++;
                    }
                }
                if(cnt==8) answer++;
            }
            System.out.println(answer);
        }
    } main {
        Scanner scn=new Scanner(System.in);
        int n = scn.nextInt();
        int answer=1;
        if(n<105){
            System.out.println(0);
        }else{
            for(int i= 107;i<=n;i+=2){
                int cnt=0;
                for(int j=1;j<=i;j+=2){
                    if(i%j==0){
                        cnt++;
                    }
                }
                if(cnt==8) answer++;
            }
            System.out.println(answer);
        }
    } Scanner scn=new Scanner(System.in); scn new Scanner(System.in) int n = scn.nextInt(); n scn.nextInt() scn.nextInt scn int answer=1; answer 1 if(n<105){
            System.out.println(0);
        }else{
            for(int i= 107;i<=n;i+=2){
                int cnt=0;
                for(int j=1;j<=i;j+=2){
                    if(i%j==0){
                        cnt++;
                    }
                }
                if(cnt==8) answer++;
            }
            System.out.println(answer);
        } n<105 n 105 {
            System.out.println(0);
        } System.out.println(0) System.out.println System.out System System.out 0 {
            for(int i= 107;i<=n;i+=2){
                int cnt=0;
                for(int j=1;j<=i;j+=2){
                    if(i%j==0){
                        cnt++;
                    }
                }
                if(cnt==8) answer++;
            }
            System.out.println(answer);
        } for(int i= 107;i<=n;i+=2){
                int cnt=0;
                for(int j=1;j<=i;j+=2){
                    if(i%j==0){
                        cnt++;
                    }
                }
                if(cnt==8) answer++;
            } int i= 107; int i= 107; i 107 i<=n i n i+=2 i+=2 i 2 {
                int cnt=0;
                for(int j=1;j<=i;j+=2){
                    if(i%j==0){
                        cnt++;
                    }
                }
                if(cnt==8) answer++;
            } {
                int cnt=0;
                for(int j=1;j<=i;j+=2){
                    if(i%j==0){
                        cnt++;
                    }
                }
                if(cnt==8) answer++;
            } int cnt=0; cnt 0 for(int j=1;j<=i;j+=2){
                    if(i%j==0){
                        cnt++;
                    }
                } int j=1; int j=1; j 1 j<=i j i j+=2 j+=2 j 2 {
                    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) answer++; cnt==8 cnt 8 answer++ answer System.out.println(answer) System.out.println System.out System System.out answer String arg[] arg
import java.util.Scanner;
class Main{
    public static void main(String arg[]){
        Scanner scn=new Scanner(System.in);
        int n = scn.nextInt();
        int answer=1;
        if(n<105){
            System.out.println(0);
        }else{
            for(int i= 107;i<=n;i+=2){
                int cnt=0;
                for(int j=1;j<=i;j+=2){
                    if(i%j==0){
                        cnt++;
                    }
                }
                if(cnt==8) answer++;
            }
            System.out.println(answer);
        }
    }
}