import java.util.Scanner;

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);
        } else {
            if (n < 135){
                System.out.println(1);
            } else {
                if (n < 165){
                    System.out.println(2);
                } else {
                    if (n < 189){
                        System.out.println(3);
                    } else {
                        if (n < 195){
                            System.out.println(4);
                        } else {
                            System.out.println(5);
                        }
                    }
                }
            }
        }
    }
}


 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();


        if (n < 105){
            System.out.println(0);
        } else {
            if (n < 135){
                System.out.println(1);
            } else {
                if (n < 165){
                    System.out.println(2);
                } else {
                    if (n < 189){
                        System.out.println(3);
                    } else {
                        if (n < 195){
                            System.out.println(4);
                        } else {
                            System.out.println(5);
                        }
                    }
                }
            }
        }
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();


        if (n < 105){
            System.out.println(0);
        } else {
            if (n < 135){
                System.out.println(1);
            } else {
                if (n < 165){
                    System.out.println(2);
                } else {
                    if (n < 189){
                        System.out.println(3);
                    } else {
                        if (n < 195){
                            System.out.println(4);
                        } else {
                            System.out.println(5);
                        }
                    }
                }
            }
        }
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();


        if (n < 105){
            System.out.println(0);
        } else {
            if (n < 135){
                System.out.println(1);
            } else {
                if (n < 165){
                    System.out.println(2);
                } else {
                    if (n < 189){
                        System.out.println(3);
                    } else {
                        if (n < 195){
                            System.out.println(4);
                        } else {
                            System.out.println(5);
                        }
                    }
                }
            }
        }
    } 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);
        } else {
            if (n < 135){
                System.out.println(1);
            } else {
                if (n < 165){
                    System.out.println(2);
                } else {
                    if (n < 189){
                        System.out.println(3);
                    } else {
                        if (n < 195){
                            System.out.println(4);
                        } else {
                            System.out.println(5);
                        }
                    }
                }
            }
        } n < 105 n 105 {
            System.out.println(0);
        } System.out.println(0) System.out.println System.out System System.out 0 {
            if (n < 135){
                System.out.println(1);
            } else {
                if (n < 165){
                    System.out.println(2);
                } else {
                    if (n < 189){
                        System.out.println(3);
                    } else {
                        if (n < 195){
                            System.out.println(4);
                        } else {
                            System.out.println(5);
                        }
                    }
                }
            }
        } if (n < 135){
                System.out.println(1);
            } else {
                if (n < 165){
                    System.out.println(2);
                } else {
                    if (n < 189){
                        System.out.println(3);
                    } else {
                        if (n < 195){
                            System.out.println(4);
                        } else {
                            System.out.println(5);
                        }
                    }
                }
            } n < 135 n 135 {
                System.out.println(1);
            } System.out.println(1) System.out.println System.out System System.out 1 {
                if (n < 165){
                    System.out.println(2);
                } else {
                    if (n < 189){
                        System.out.println(3);
                    } else {
                        if (n < 195){
                            System.out.println(4);
                        } else {
                            System.out.println(5);
                        }
                    }
                }
            } if (n < 165){
                    System.out.println(2);
                } else {
                    if (n < 189){
                        System.out.println(3);
                    } else {
                        if (n < 195){
                            System.out.println(4);
                        } else {
                            System.out.println(5);
                        }
                    }
                } n < 165 n 165 {
                    System.out.println(2);
                } System.out.println(2) System.out.println System.out System System.out 2 {
                    if (n < 189){
                        System.out.println(3);
                    } else {
                        if (n < 195){
                            System.out.println(4);
                        } else {
                            System.out.println(5);
                        }
                    }
                } if (n < 189){
                        System.out.println(3);
                    } else {
                        if (n < 195){
                            System.out.println(4);
                        } else {
                            System.out.println(5);
                        }
                    } n < 189 n 189 {
                        System.out.println(3);
                    } System.out.println(3) System.out.println System.out System System.out 3 {
                        if (n < 195){
                            System.out.println(4);
                        } else {
                            System.out.println(5);
                        }
                    } if (n < 195){
                            System.out.println(4);
                        } else {
                            System.out.println(5);
                        } n < 195 n 195 {
                            System.out.println(4);
                        } System.out.println(4) System.out.println System.out System System.out 4 {
                            System.out.println(5);
                        } System.out.println(5) System.out.println System.out System System.out 5 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);
        } else {
            if (n < 135){
                System.out.println(1);
            } else {
                if (n < 165){
                    System.out.println(2);
                } else {
                    if (n < 189){
                        System.out.println(3);
                    } else {
                        if (n < 195){
                            System.out.println(4);
                        } else {
                            System.out.println(5);
                        }
                    }
                }
            }
        }
    }
} 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);
        } else {
            if (n < 135){
                System.out.println(1);
            } else {
                if (n < 165){
                    System.out.println(2);
                } else {
                    if (n < 189){
                        System.out.println(3);
                    } else {
                        if (n < 195){
                            System.out.println(4);
                        } else {
                            System.out.println(5);
                        }
                    }
                }
            }
        }
    }
} Main
import java.util.Scanner;

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);
        } else {
            if (n < 135){
                System.out.println(1);
            } else {
                if (n < 165){
                    System.out.println(2);
                } else {
                    if (n < 189){
                        System.out.println(3);
                    } else {
                        if (n < 195){
                            System.out.println(4);
                        } else {
                            System.out.println(5);
                        }
                    }
                }
            }
        }
    }
}



