import java.util.HashMap;
import java.util.Scanner;

public class Main {

    static Scanner sc = new Scanner(System.in);


    public static void main(String[] args) {

        int a = sc.nextInt();
        if (a < 105) {
            System.out.println(0);
            return;
        }
        int ans = 0;
        int start = a;
        if (a % 2 == 0) {
            start = a - 1;
        }

        while (start >= 1) {
            if (calc(start)) {
//                System.out.println(start);
                ans++;
            }
            start = start - 2;
        }
        System.out.println(ans);
    }

    private static boolean calc(int start) {
        int num = start;
        int count = 2;
        HashMap<Integer, Integer> map = new HashMap<>();
        while (num > 1) {
            if (num % count == 0) {
                num = num / count;
                if (map.containsKey(count)) {
                    map.put(count, map.get(count) + 1);
                } else {
                    map.put(count, 1);
                }
            } else {
                count++;
            }
        }
        int ans = 1;
        for (Integer key : map.keySet()) {
            ans *= (map.get(key) + 1);
        }
        return ans == 8;
    }
} import java.util.HashMap; HashMap java.util import java.util.Scanner; Scanner java.util public class Main {

    static Scanner sc = new Scanner(System.in);


    public static void main(String[] args) {

        int a = sc.nextInt();
        if (a < 105) {
            System.out.println(0);
            return;
        }
        int ans = 0;
        int start = a;
        if (a % 2 == 0) {
            start = a - 1;
        }

        while (start >= 1) {
            if (calc(start)) {
//                System.out.println(start);
                ans++;
            }
            start = start - 2;
        }
        System.out.println(ans);
    }

    private static boolean calc(int start) {
        int num = start;
        int count = 2;
        HashMap<Integer, Integer> map = new HashMap<>();
        while (num > 1) {
            if (num % count == 0) {
                num = num / count;
                if (map.containsKey(count)) {
                    map.put(count, map.get(count) + 1);
                } else {
                    map.put(count, 1);
                }
            } else {
                count++;
            }
        }
        int ans = 1;
        for (Integer key : map.keySet()) {
            ans *= (map.get(key) + 1);
        }
        return ans == 8;
    }
} Main static Scanner sc = new Scanner(System.in); sc new Scanner(System.in) public static void main(String[] args) {

        int a = sc.nextInt();
        if (a < 105) {
            System.out.println(0);
            return;
        }
        int ans = 0;
        int start = a;
        if (a % 2 == 0) {
            start = a - 1;
        }

        while (start >= 1) {
            if (calc(start)) {
//                System.out.println(start);
                ans++;
            }
            start = start - 2;
        }
        System.out.println(ans);
    } main {

        int a = sc.nextInt();
        if (a < 105) {
            System.out.println(0);
            return;
        }
        int ans = 0;
        int start = a;
        if (a % 2 == 0) {
            start = a - 1;
        }

        while (start >= 1) {
            if (calc(start)) {
//                System.out.println(start);
                ans++;
            }
            start = start - 2;
        }
        System.out.println(ans);
    } int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc if (a < 105) {
            System.out.println(0);
            return;
        } a < 105 a 105 {
            System.out.println(0);
            return;
        } System.out.println(0) System.out.println System.out System System.out 0 return; int ans = 0; ans 0 int start = a; start a if (a % 2 == 0) {
            start = a - 1;
        } a % 2 == 0 a % 2 a 2 0 {
            start = a - 1;
        } start = a - 1 start a - 1 a 1 while (start >= 1) {
            if (calc(start)) {
//                System.out.println(start);
                ans++;
            }
            start = start - 2;
        } start >= 1 start 1 {
            if (calc(start)) {
//                System.out.println(start);
                ans++;
            }
            start = start - 2;
        } if (calc(start)) {
//                System.out.println(start);
                ans++;
            } calc(start) calc start {
//                System.out.println(start);
                ans++;
            } ans++ ans start = start - 2 start start - 2 start 2 System.out.println(ans) System.out.println System.out System System.out ans String[] args args private static boolean calc(int start) {
        int num = start;
        int count = 2;
        HashMap<Integer, Integer> map = new HashMap<>();
        while (num > 1) {
            if (num % count == 0) {
                num = num / count;
                if (map.containsKey(count)) {
                    map.put(count, map.get(count) + 1);
                } else {
                    map.put(count, 1);
                }
            } else {
                count++;
            }
        }
        int ans = 1;
        for (Integer key : map.keySet()) {
            ans *= (map.get(key) + 1);
        }
        return ans == 8;
    } calc {
        int num = start;
        int count = 2;
        HashMap<Integer, Integer> map = new HashMap<>();
        while (num > 1) {
            if (num % count == 0) {
                num = num / count;
                if (map.containsKey(count)) {
                    map.put(count, map.get(count) + 1);
                } else {
                    map.put(count, 1);
                }
            } else {
                count++;
            }
        }
        int ans = 1;
        for (Integer key : map.keySet()) {
            ans *= (map.get(key) + 1);
        }
        return ans == 8;
    } int num = start; num start int count = 2; count 2 HashMap<Integer, Integer> map = new HashMap<>(); map new HashMap<>() while (num > 1) {
            if (num % count == 0) {
                num = num / count;
                if (map.containsKey(count)) {
                    map.put(count, map.get(count) + 1);
                } else {
                    map.put(count, 1);
                }
            } else {
                count++;
            }
        } num > 1 num 1 {
            if (num % count == 0) {
                num = num / count;
                if (map.containsKey(count)) {
                    map.put(count, map.get(count) + 1);
                } else {
                    map.put(count, 1);
                }
            } else {
                count++;
            }
        } if (num % count == 0) {
                num = num / count;
                if (map.containsKey(count)) {
                    map.put(count, map.get(count) + 1);
                } else {
                    map.put(count, 1);
                }
            } else {
                count++;
            } num % count == 0 num % count num count 0 {
                num = num / count;
                if (map.containsKey(count)) {
                    map.put(count, map.get(count) + 1);
                } else {
                    map.put(count, 1);
                }
            } num = num / count num num / count num count if (map.containsKey(count)) {
                    map.put(count, map.get(count) + 1);
                } else {
                    map.put(count, 1);
                } map.containsKey(count) map.containsKey map count {
                    map.put(count, map.get(count) + 1);
                } map.put(count, map.get(count) + 1) map.put map count map.get(count) + 1 map.get(count) map.get map count 1 {
                    map.put(count, 1);
                } map.put(count, 1) map.put map count 1 {
                count++;
            } count++ count int ans = 1; ans 1 for (Integer key : map.keySet()) {
            ans *= (map.get(key) + 1);
        } Integer key map.keySet() map.keySet map {
            ans *= (map.get(key) + 1);
        } {
            ans *= (map.get(key) + 1);
        } ans *= (map.get(key) + 1) ans (map.get(key) + 1) map.get(key) map.get map key 1 return ans == 8; ans == 8 ans 8 int start start public class Main {

    static Scanner sc = new Scanner(System.in);


    public static void main(String[] args) {

        int a = sc.nextInt();
        if (a < 105) {
            System.out.println(0);
            return;
        }
        int ans = 0;
        int start = a;
        if (a % 2 == 0) {
            start = a - 1;
        }

        while (start >= 1) {
            if (calc(start)) {
//                System.out.println(start);
                ans++;
            }
            start = start - 2;
        }
        System.out.println(ans);
    }

    private static boolean calc(int start) {
        int num = start;
        int count = 2;
        HashMap<Integer, Integer> map = new HashMap<>();
        while (num > 1) {
            if (num % count == 0) {
                num = num / count;
                if (map.containsKey(count)) {
                    map.put(count, map.get(count) + 1);
                } else {
                    map.put(count, 1);
                }
            } else {
                count++;
            }
        }
        int ans = 1;
        for (Integer key : map.keySet()) {
            ans *= (map.get(key) + 1);
        }
        return ans == 8;
    }
} public class Main {

    static Scanner sc = new Scanner(System.in);


    public static void main(String[] args) {

        int a = sc.nextInt();
        if (a < 105) {
            System.out.println(0);
            return;
        }
        int ans = 0;
        int start = a;
        if (a % 2 == 0) {
            start = a - 1;
        }

        while (start >= 1) {
            if (calc(start)) {
//                System.out.println(start);
                ans++;
            }
            start = start - 2;
        }
        System.out.println(ans);
    }

    private static boolean calc(int start) {
        int num = start;
        int count = 2;
        HashMap<Integer, Integer> map = new HashMap<>();
        while (num > 1) {
            if (num % count == 0) {
                num = num / count;
                if (map.containsKey(count)) {
                    map.put(count, map.get(count) + 1);
                } else {
                    map.put(count, 1);
                }
            } else {
                count++;
            }
        }
        int ans = 1;
        for (Integer key : map.keySet()) {
            ans *= (map.get(key) + 1);
        }
        return ans == 8;
    }
} Main
import java.util.HashMap;
import java.util.Scanner;

public class Main {

    static Scanner sc = new Scanner(System.in);


    public static void main(String[] args) {

        int a = sc.nextInt();
        if (a < 105) {
            System.out.println(0);
            return;
        }
        int ans = 0;
        int start = a;
        if (a % 2 == 0) {
            start = a - 1;
        }

        while (start >= 1) {
            if (calc(start)) {
//                System.out.println(start);
                ans++;
            }
            start = start - 2;
        }
        System.out.println(ans);
    }

    private static boolean calc(int start) {
        int num = start;
        int count = 2;
        HashMap<Integer, Integer> map = new HashMap<>();
        while (num > 1) {
            if (num % count == 0) {
                num = num / count;
                if (map.containsKey(count)) {
                    map.put(count, map.get(count) + 1);
                } else {
                    map.put(count, 1);
                }
            } else {
                count++;
            }
        }
        int ans = 1;
        for (Integer key : map.keySet()) {
            ans *= (map.get(key) + 1);
        }
        return ans == 8;
    }
}
