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;
    }
}

/tmp/hf-datasets-cache/medium/datasets/42704881117311-config-parquet-and-info-qiankunmu-Project_CodeNet-896c9d36/hub/datasets--qiankunmu--Project_CodeNet_Python800_and_Java250/snapshots/c899fde44a77ba1cc14973ed3de064e4ff3aadc7/Project_CodeNet_Java250.tar.gz