import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = Integer.parseInt(scanner.nextLine());
        if (n < 105) {
            System.out.println(0);
            return;
        }

        int count = 0;
        for (int i = 105; i <= n; i += 2) {
            int modCount = 0;
            for (int j = 1; j <= i; j++) {
                if (i % j == 0) {
                    modCount++;
                }
            }
            if (modCount == 8) {
                count++;
            }
        }
        System.out.println(count);
    }
} import java.util.*; util.* java class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = Integer.parseInt(scanner.nextLine());
        if (n < 105) {
            System.out.println(0);
            return;
        }

        int count = 0;
        for (int i = 105; i <= n; i += 2) {
            int modCount = 0;
            for (int j = 1; j <= i; j++) {
                if (i % j == 0) {
                    modCount++;
                }
            }
            if (modCount == 8) {
                count++;
            }
        }
        System.out.println(count);
    }
} Main public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = Integer.parseInt(scanner.nextLine());
        if (n < 105) {
            System.out.println(0);
            return;
        }

        int count = 0;
        for (int i = 105; i <= n; i += 2) {
            int modCount = 0;
            for (int j = 1; j <= i; j++) {
                if (i % j == 0) {
                    modCount++;
                }
            }
            if (modCount == 8) {
                count++;
            }
        }
        System.out.println(count);
    } main {
        Scanner scanner = new Scanner(System.in);
        int n = Integer.parseInt(scanner.nextLine());
        if (n < 105) {
            System.out.println(0);
            return;
        }

        int count = 0;
        for (int i = 105; i <= n; i += 2) {
            int modCount = 0;
            for (int j = 1; j <= i; j++) {
                if (i % j == 0) {
                    modCount++;
                }
            }
            if (modCount == 8) {
                count++;
            }
        }
        System.out.println(count);
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int n = Integer.parseInt(scanner.nextLine()); n Integer.parseInt(scanner.nextLine()) Integer.parseInt Integer scanner.nextLine() scanner.nextLine scanner if (n < 105) {
            System.out.println(0);
            return;
        } n < 105 n 105 {
            System.out.println(0);
            return;
        } System.out.println(0) System.out.println System.out System System.out 0 return; int count = 0; count 0 for (int i = 105; i <= n; i += 2) {
            int modCount = 0;
            for (int j = 1; j <= i; j++) {
                if (i % j == 0) {
                    modCount++;
                }
            }
            if (modCount == 8) {
                count++;
            }
        } int i = 105; int i = 105; i 105 i <= n i n i += 2 i += 2 i 2 {
            int modCount = 0;
            for (int j = 1; j <= i; j++) {
                if (i % j == 0) {
                    modCount++;
                }
            }
            if (modCount == 8) {
                count++;
            }
        } {
            int modCount = 0;
            for (int j = 1; j <= i; j++) {
                if (i % j == 0) {
                    modCount++;
                }
            }
            if (modCount == 8) {
                count++;
            }
        } int modCount = 0; modCount 0 for (int j = 1; j <= i; j++) {
                if (i % j == 0) {
                    modCount++;
                }
            } int j = 1; int j = 1; j 1 j <= i j i j++ j++ j {
                if (i % j == 0) {
                    modCount++;
                }
            } {
                if (i % j == 0) {
                    modCount++;
                }
            } if (i % j == 0) {
                    modCount++;
                } i % j == 0 i % j i j 0 {
                    modCount++;
                } modCount++ modCount if (modCount == 8) {
                count++;
            } modCount == 8 modCount 8 {
                count++;
            } count++ count System.out.println(count) System.out.println System.out System System.out count String[] args args
import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = Integer.parseInt(scanner.nextLine());
        if (n < 105) {
            System.out.println(0);
            return;
        }

        int count = 0;
        for (int i = 105; i <= n; i += 2) {
            int modCount = 0;
            for (int j = 1; j <= i; j++) {
                if (i % j == 0) {
                    modCount++;
                }
            }
            if (modCount == 8) {
                count++;
            }
        }
        System.out.println(count);
    }
}
