import java.util.*;
import java.util.Map.*;   // Entryを使うときは、paizaではこれを宣言する

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        Sieve sieve = new Sieve(n);
        
        if (n < 105) {
            System.out.println(0);
            return;
        }
        
        int count = 0;
        for (int i = 105; i <= n; i++) {
            if (i % 2 == 0) continue;
            
            Map<Integer, Integer> map = sieve.factorMap(i);
            
            int yakusuu = 1;
            for (Entry<Integer, Integer> entry : map.entrySet()) {
                yakusuu *= (entry.getValue() + 1);
            }
            if (yakusuu == 8) count++;
        }
        
        System.out.println(count);
    }
}

class Sieve {
    int[] minFactor;    // 最小の素因数

    Sieve(int n) {
        minFactor = new int[n + 1];
        minFactor[0] = -1;
        minFactor[1] = -1;
        
        for (int i = 2; i <= n; i++) {
            if (minFactor[i] != 0) continue;
            
            minFactor[i] = i;
            
            if ((long)i * i > (long)n) continue;
            
            for (int j = i * i; j <= n; j += i) {
                if (minFactor[j] != 0) continue;
                
                minFactor[j] = i;
            }
        }
    }
    
    boolean isPrime(int x) {
        if (minFactor[x] == x) {
            return true;
        }
        
        return false;
    }
    
    // nの素因数のリスト (60 => [2, 2, 3, 5])
    List<Integer> factorList(int x) {
        List<Integer> res = new ArrayList<Integer>();
        
        while (x != 1) {
            res.add(minFactor[x]);
            x /= minFactor[x];
        }
        
        return res;
    }
    
    // nの素因数の頻度 (60 => (2 => 2, 3 => 1, 5 => 1)
    Map<Integer, Integer> factorMap(int x) {
        Map<Integer, Integer> res = new HashMap<Integer, Integer>();
        
        List<Integer> factorList = factorList(x);
        
        for (Integer f : factorList) {
            if (!res.containsKey(f)) {
                res.put(f, 1);
            } else {
                int count = res.get(f);
                res.put(f, count + 1);
            }
        }
        
        // for (int i = 1; i <= x; i++) {
        //     if (!res.containsKey(i)) {
        //         res.put(i, 0);
        //     }
        // }
        
        return res;
    }
} import java.util.*; util.* java import java.util.Map.*;   // Entryを使うときは、paizaではこれを宣言する Map.* java.util public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        Sieve sieve = new Sieve(n);
        
        if (n < 105) {
            System.out.println(0);
            return;
        }
        
        int count = 0;
        for (int i = 105; i <= n; i++) {
            if (i % 2 == 0) continue;
            
            Map<Integer, Integer> map = sieve.factorMap(i);
            
            int yakusuu = 1;
            for (Entry<Integer, Integer> entry : map.entrySet()) {
                yakusuu *= (entry.getValue() + 1);
            }
            if (yakusuu == 8) count++;
        }
        
        System.out.println(count);
    }
} Main public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        Sieve sieve = new Sieve(n);
        
        if (n < 105) {
            System.out.println(0);
            return;
        }
        
        int count = 0;
        for (int i = 105; i <= n; i++) {
            if (i % 2 == 0) continue;
            
            Map<Integer, Integer> map = sieve.factorMap(i);
            
            int yakusuu = 1;
            for (Entry<Integer, Integer> entry : map.entrySet()) {
                yakusuu *= (entry.getValue() + 1);
            }
            if (yakusuu == 8) count++;
        }
        
        System.out.println(count);
    } main {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        Sieve sieve = new Sieve(n);
        
        if (n < 105) {
            System.out.println(0);
            return;
        }
        
        int count = 0;
        for (int i = 105; i <= n; i++) {
            if (i % 2 == 0) continue;
            
            Map<Integer, Integer> map = sieve.factorMap(i);
            
            int yakusuu = 1;
            for (Entry<Integer, Integer> entry : map.entrySet()) {
                yakusuu *= (entry.getValue() + 1);
            }
            if (yakusuu == 8) count++;
        }
        
        System.out.println(count);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc Sieve sieve = new Sieve(n); sieve new Sieve(n) 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++) {
            if (i % 2 == 0) continue;
            
            Map<Integer, Integer> map = sieve.factorMap(i);
            
            int yakusuu = 1;
            for (Entry<Integer, Integer> entry : map.entrySet()) {
                yakusuu *= (entry.getValue() + 1);
            }
            if (yakusuu == 8) count++;
        } int i = 105; int i = 105; i 105 i <= n i n i++ i++ i {
            if (i % 2 == 0) continue;
            
            Map<Integer, Integer> map = sieve.factorMap(i);
            
            int yakusuu = 1;
            for (Entry<Integer, Integer> entry : map.entrySet()) {
                yakusuu *= (entry.getValue() + 1);
            }
            if (yakusuu == 8) count++;
        } {
            if (i % 2 == 0) continue;
            
            Map<Integer, Integer> map = sieve.factorMap(i);
            
            int yakusuu = 1;
            for (Entry<Integer, Integer> entry : map.entrySet()) {
                yakusuu *= (entry.getValue() + 1);
            }
            if (yakusuu == 8) count++;
        } if (i % 2 == 0) continue; i % 2 == 0 i % 2 i 2 0 continue; Map<Integer, Integer> map = sieve.factorMap(i); map sieve.factorMap(i) sieve.factorMap sieve i int yakusuu = 1; yakusuu 1 for (Entry<Integer, Integer> entry : map.entrySet()) {
                yakusuu *= (entry.getValue() + 1);
            } Entry<Integer, Integer> entry map.entrySet() map.entrySet map {
                yakusuu *= (entry.getValue() + 1);
            } {
                yakusuu *= (entry.getValue() + 1);
            } yakusuu *= (entry.getValue() + 1) yakusuu (entry.getValue() + 1) entry.getValue() entry.getValue entry 1 if (yakusuu == 8) count++; yakusuu == 8 yakusuu 8 count++ count System.out.println(count) System.out.println System.out System System.out count String[] args args class Sieve {
    int[] minFactor;    // 最小の素因数

    Sieve(int n) {
        minFactor = new int[n + 1];
        minFactor[0] = -1;
        minFactor[1] = -1;
        
        for (int i = 2; i <= n; i++) {
            if (minFactor[i] != 0) continue;
            
            minFactor[i] = i;
            
            if ((long)i * i > (long)n) continue;
            
            for (int j = i * i; j <= n; j += i) {
                if (minFactor[j] != 0) continue;
                
                minFactor[j] = i;
            }
        }
    }
    
    boolean isPrime(int x) {
        if (minFactor[x] == x) {
            return true;
        }
        
        return false;
    }
    
    // nの素因数のリスト (60 => [2, 2, 3, 5])
    List<Integer> factorList(int x) {
        List<Integer> res = new ArrayList<Integer>();
        
        while (x != 1) {
            res.add(minFactor[x]);
            x /= minFactor[x];
        }
        
        return res;
    }
    
    // nの素因数の頻度 (60 => (2 => 2, 3 => 1, 5 => 1)
    Map<Integer, Integer> factorMap(int x) {
        Map<Integer, Integer> res = new HashMap<Integer, Integer>();
        
        List<Integer> factorList = factorList(x);
        
        for (Integer f : factorList) {
            if (!res.containsKey(f)) {
                res.put(f, 1);
            } else {
                int count = res.get(f);
                res.put(f, count + 1);
            }
        }
        
        // for (int i = 1; i <= x; i++) {
        //     if (!res.containsKey(i)) {
        //         res.put(i, 0);
        //     }
        // }
        
        return res;
    }
} Sieve int[] minFactor;    // 最小の素因数 minFactor Sieve(int n) {
        minFactor = new int[n + 1];
        minFactor[0] = -1;
        minFactor[1] = -1;
        
        for (int i = 2; i <= n; i++) {
            if (minFactor[i] != 0) continue;
            
            minFactor[i] = i;
            
            if ((long)i * i > (long)n) continue;
            
            for (int j = i * i; j <= n; j += i) {
                if (minFactor[j] != 0) continue;
                
                minFactor[j] = i;
            }
        }
    } Sieve {
        minFactor = new int[n + 1];
        minFactor[0] = -1;
        minFactor[1] = -1;
        
        for (int i = 2; i <= n; i++) {
            if (minFactor[i] != 0) continue;
            
            minFactor[i] = i;
            
            if ((long)i * i > (long)n) continue;
            
            for (int j = i * i; j <= n; j += i) {
                if (minFactor[j] != 0) continue;
                
                minFactor[j] = i;
            }
        }
    } minFactor = new int[n + 1] minFactor new int[n + 1] n + 1 n 1 minFactor[0] = -1 minFactor[0] minFactor 0 -1 1 minFactor[1] = -1 minFactor[1] minFactor 1 -1 1 for (int i = 2; i <= n; i++) {
            if (minFactor[i] != 0) continue;
            
            minFactor[i] = i;
            
            if ((long)i * i > (long)n) continue;
            
            for (int j = i * i; j <= n; j += i) {
                if (minFactor[j] != 0) continue;
                
                minFactor[j] = i;
            }
        } int i = 2; int i = 2; i 2 i <= n i n i++ i++ i {
            if (minFactor[i] != 0) continue;
            
            minFactor[i] = i;
            
            if ((long)i * i > (long)n) continue;
            
            for (int j = i * i; j <= n; j += i) {
                if (minFactor[j] != 0) continue;
                
                minFactor[j] = i;
            }
        } {
            if (minFactor[i] != 0) continue;
            
            minFactor[i] = i;
            
            if ((long)i * i > (long)n) continue;
            
            for (int j = i * i; j <= n; j += i) {
                if (minFactor[j] != 0) continue;
                
                minFactor[j] = i;
            }
        } if (minFactor[i] != 0) continue; minFactor[i] != 0 minFactor[i] minFactor i 0 continue; minFactor[i] = i minFactor[i] minFactor i i if ((long)i * i > (long)n) continue; (long)i * i > (long)n (long)i * i (long)i i (long)n continue; for (int j = i * i; j <= n; j += i) {
                if (minFactor[j] != 0) continue;
                
                minFactor[j] = i;
            } int j = i * i; int j = i * i; j i * i i i j <= n j n j += i j += i j i {
                if (minFactor[j] != 0) continue;
                
                minFactor[j] = i;
            } {
                if (minFactor[j] != 0) continue;
                
                minFactor[j] = i;
            } if (minFactor[j] != 0) continue; minFactor[j] != 0 minFactor[j] minFactor j 0 continue; minFactor[j] = i minFactor[j] minFactor j i int n n boolean isPrime(int x) {
        if (minFactor[x] == x) {
            return true;
        }
        
        return false;
    } isPrime {
        if (minFactor[x] == x) {
            return true;
        }
        
        return false;
    } if (minFactor[x] == x) {
            return true;
        } minFactor[x] == x minFactor[x] minFactor x x {
            return true;
        } return true; true return false; false int x x // nの素因数のリスト (60 => [2, 2, 3, 5])
    List<Integer> factorList(int x) {
        List<Integer> res = new ArrayList<Integer>();
        
        while (x != 1) {
            res.add(minFactor[x]);
            x /= minFactor[x];
        }
        
        return res;
    } factorList {
        List<Integer> res = new ArrayList<Integer>();
        
        while (x != 1) {
            res.add(minFactor[x]);
            x /= minFactor[x];
        }
        
        return res;
    } List<Integer> res = new ArrayList<Integer>(); res new ArrayList<Integer>() while (x != 1) {
            res.add(minFactor[x]);
            x /= minFactor[x];
        } x != 1 x 1 {
            res.add(minFactor[x]);
            x /= minFactor[x];
        } res.add(minFactor[x]) res.add res minFactor[x] minFactor x x /= minFactor[x] x minFactor[x] minFactor x return res; res int x x // nの素因数の頻度 (60 => (2 => 2, 3 => 1, 5 => 1)
    Map<Integer, Integer> factorMap(int x) {
        Map<Integer, Integer> res = new HashMap<Integer, Integer>();
        
        List<Integer> factorList = factorList(x);
        
        for (Integer f : factorList) {
            if (!res.containsKey(f)) {
                res.put(f, 1);
            } else {
                int count = res.get(f);
                res.put(f, count + 1);
            }
        }
        
        // for (int i = 1; i <= x; i++) {
        //     if (!res.containsKey(i)) {
        //         res.put(i, 0);
        //     }
        // }
        
        return res;
    } factorMap {
        Map<Integer, Integer> res = new HashMap<Integer, Integer>();
        
        List<Integer> factorList = factorList(x);
        
        for (Integer f : factorList) {
            if (!res.containsKey(f)) {
                res.put(f, 1);
            } else {
                int count = res.get(f);
                res.put(f, count + 1);
            }
        }
        
        // for (int i = 1; i <= x; i++) {
        //     if (!res.containsKey(i)) {
        //         res.put(i, 0);
        //     }
        // }
        
        return res;
    } Map<Integer, Integer> res = new HashMap<Integer, Integer>(); res new HashMap<Integer, Integer>() List<Integer> factorList = factorList(x); factorList factorList(x) factorList x for (Integer f : factorList) {
            if (!res.containsKey(f)) {
                res.put(f, 1);
            } else {
                int count = res.get(f);
                res.put(f, count + 1);
            }
        } Integer f factorList {
            if (!res.containsKey(f)) {
                res.put(f, 1);
            } else {
                int count = res.get(f);
                res.put(f, count + 1);
            }
        } {
            if (!res.containsKey(f)) {
                res.put(f, 1);
            } else {
                int count = res.get(f);
                res.put(f, count + 1);
            }
        } if (!res.containsKey(f)) {
                res.put(f, 1);
            } else {
                int count = res.get(f);
                res.put(f, count + 1);
            } !res.containsKey(f) res.containsKey(f) res.containsKey res f {
                res.put(f, 1);
            } res.put(f, 1) res.put res f 1 {
                int count = res.get(f);
                res.put(f, count + 1);
            } int count = res.get(f); count res.get(f) res.get res f res.put(f, count + 1) res.put res f count + 1 count 1 return res; res int x x public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        Sieve sieve = new Sieve(n);
        
        if (n < 105) {
            System.out.println(0);
            return;
        }
        
        int count = 0;
        for (int i = 105; i <= n; i++) {
            if (i % 2 == 0) continue;
            
            Map<Integer, Integer> map = sieve.factorMap(i);
            
            int yakusuu = 1;
            for (Entry<Integer, Integer> entry : map.entrySet()) {
                yakusuu *= (entry.getValue() + 1);
            }
            if (yakusuu == 8) count++;
        }
        
        System.out.println(count);
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        Sieve sieve = new Sieve(n);
        
        if (n < 105) {
            System.out.println(0);
            return;
        }
        
        int count = 0;
        for (int i = 105; i <= n; i++) {
            if (i % 2 == 0) continue;
            
            Map<Integer, Integer> map = sieve.factorMap(i);
            
            int yakusuu = 1;
            for (Entry<Integer, Integer> entry : map.entrySet()) {
                yakusuu *= (entry.getValue() + 1);
            }
            if (yakusuu == 8) count++;
        }
        
        System.out.println(count);
    }
} Main
import java.util.*;
import java.util.Map.*;   // Entryを使うときは、paizaではこれを宣言する

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        Sieve sieve = new Sieve(n);
        
        if (n < 105) {
            System.out.println(0);
            return;
        }
        
        int count = 0;
        for (int i = 105; i <= n; i++) {
            if (i % 2 == 0) continue;
            
            Map<Integer, Integer> map = sieve.factorMap(i);
            
            int yakusuu = 1;
            for (Entry<Integer, Integer> entry : map.entrySet()) {
                yakusuu *= (entry.getValue() + 1);
            }
            if (yakusuu == 8) count++;
        }
        
        System.out.println(count);
    }
}

class Sieve {
    int[] minFactor;    // 最小の素因数

    Sieve(int n) {
        minFactor = new int[n + 1];
        minFactor[0] = -1;
        minFactor[1] = -1;
        
        for (int i = 2; i <= n; i++) {
            if (minFactor[i] != 0) continue;
            
            minFactor[i] = i;
            
            if ((long)i * i > (long)n) continue;
            
            for (int j = i * i; j <= n; j += i) {
                if (minFactor[j] != 0) continue;
                
                minFactor[j] = i;
            }
        }
    }
    
    boolean isPrime(int x) {
        if (minFactor[x] == x) {
            return true;
        }
        
        return false;
    }
    
    // nの素因数のリスト (60 => [2, 2, 3, 5])
    List<Integer> factorList(int x) {
        List<Integer> res = new ArrayList<Integer>();
        
        while (x != 1) {
            res.add(minFactor[x]);
            x /= minFactor[x];
        }
        
        return res;
    }
    
    // nの素因数の頻度 (60 => (2 => 2, 3 => 1, 5 => 1)
    Map<Integer, Integer> factorMap(int x) {
        Map<Integer, Integer> res = new HashMap<Integer, Integer>();
        
        List<Integer> factorList = factorList(x);
        
        for (Integer f : factorList) {
            if (!res.containsKey(f)) {
                res.put(f, 1);
            } else {
                int count = res.get(f);
                res.put(f, count + 1);
            }
        }
        
        // for (int i = 1; i <= x; i++) {
        //     if (!res.containsKey(i)) {
        //         res.put(i, 0);
        //     }
        // }
        
        return res;
    }
}