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

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
       long n = sc.nextLong();
       long num = 0;
       for(long i = 1 ; i <= n ; i++) {
    	   if(i % 2 == 0)
    		   continue;
    	   if(yakusuKosu(i) == 8) {
    		   num++;
    	   }


       }
       System.out.println(num);

    }
    public static long yakusuKosu(long m){
      long n = m;
		long num = 1;
		HashMap<Long, Long> map = new HashMap<>();
			for(long i = 2 ; i <= Math.sqrt(n) ; i++) {
			if(n % i != 0)
				continue;
			n /= i;
			map.put(i, map.getOrDefault(i,  0L) + 1L);
			if(n == 1)
				break;
          i--;
		}
		if(n != 1)
			map.put(n, map.getOrDefault(n,  0L) + 1L);
		for(long t : map.keySet()) {
			num *= map.get(t) + 1;

		}
		return num;

	}
    public static long pow(long ml, long a, long b){
        if(b == 1)
          return ml;
          ml *= a;
          b--;
    		return b == 0 ? ml : pow(ml , a ,b);
    	}
}


 import java.util.HashMap; HashMap java.util import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
       long n = sc.nextLong();
       long num = 0;
       for(long i = 1 ; i <= n ; i++) {
    	   if(i % 2 == 0)
    		   continue;
    	   if(yakusuKosu(i) == 8) {
    		   num++;
    	   }


       }
       System.out.println(num);

    }
    public static long yakusuKosu(long m){
      long n = m;
		long num = 1;
		HashMap<Long, Long> map = new HashMap<>();
			for(long i = 2 ; i <= Math.sqrt(n) ; i++) {
			if(n % i != 0)
				continue;
			n /= i;
			map.put(i, map.getOrDefault(i,  0L) + 1L);
			if(n == 1)
				break;
          i--;
		}
		if(n != 1)
			map.put(n, map.getOrDefault(n,  0L) + 1L);
		for(long t : map.keySet()) {
			num *= map.get(t) + 1;

		}
		return num;

	}
    public static long pow(long ml, long a, long b){
        if(b == 1)
          return ml;
          ml *= a;
          b--;
    		return b == 0 ? ml : pow(ml , a ,b);
    	}
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
       long n = sc.nextLong();
       long num = 0;
       for(long i = 1 ; i <= n ; i++) {
    	   if(i % 2 == 0)
    		   continue;
    	   if(yakusuKosu(i) == 8) {
    		   num++;
    	   }


       }
       System.out.println(num);

    } main {
        Scanner sc = new Scanner(System.in);
       long n = sc.nextLong();
       long num = 0;
       for(long i = 1 ; i <= n ; i++) {
    	   if(i % 2 == 0)
    		   continue;
    	   if(yakusuKosu(i) == 8) {
    		   num++;
    	   }


       }
       System.out.println(num);

    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long n = sc.nextLong(); n sc.nextLong() sc.nextLong sc long num = 0; num 0 for(long i = 1 ; i <= n ; i++) {
    	   if(i % 2 == 0)
    		   continue;
    	   if(yakusuKosu(i) == 8) {
    		   num++;
    	   }


       } long i = 1 ; long i = 1 ; i 1 i <= n i n i++ i++ i {
    	   if(i % 2 == 0)
    		   continue;
    	   if(yakusuKosu(i) == 8) {
    		   num++;
    	   }


       } {
    	   if(i % 2 == 0)
    		   continue;
    	   if(yakusuKosu(i) == 8) {
    		   num++;
    	   }


       } if(i % 2 == 0)
    		   continue; i % 2 == 0 i % 2 i 2 0 continue; if(yakusuKosu(i) == 8) {
    		   num++;
    	   } yakusuKosu(i) == 8 yakusuKosu(i) yakusuKosu i 8 {
    		   num++;
    	   } num++ num System.out.println(num) System.out.println System.out System System.out num String[] args args public static long yakusuKosu(long m){
      long n = m;
		long num = 1;
		HashMap<Long, Long> map = new HashMap<>();
			for(long i = 2 ; i <= Math.sqrt(n) ; i++) {
			if(n % i != 0)
				continue;
			n /= i;
			map.put(i, map.getOrDefault(i,  0L) + 1L);
			if(n == 1)
				break;
          i--;
		}
		if(n != 1)
			map.put(n, map.getOrDefault(n,  0L) + 1L);
		for(long t : map.keySet()) {
			num *= map.get(t) + 1;

		}
		return num;

	} yakusuKosu {
      long n = m;
		long num = 1;
		HashMap<Long, Long> map = new HashMap<>();
			for(long i = 2 ; i <= Math.sqrt(n) ; i++) {
			if(n % i != 0)
				continue;
			n /= i;
			map.put(i, map.getOrDefault(i,  0L) + 1L);
			if(n == 1)
				break;
          i--;
		}
		if(n != 1)
			map.put(n, map.getOrDefault(n,  0L) + 1L);
		for(long t : map.keySet()) {
			num *= map.get(t) + 1;

		}
		return num;

	} long n = m; n m long num = 1; num 1 HashMap<Long, Long> map = new HashMap<>(); map new HashMap<>() for(long i = 2 ; i <= Math.sqrt(n) ; i++) {
			if(n % i != 0)
				continue;
			n /= i;
			map.put(i, map.getOrDefault(i,  0L) + 1L);
			if(n == 1)
				break;
          i--;
		} long i = 2 ; long i = 2 ; i 2 i <= Math.sqrt(n) i Math.sqrt(n) Math.sqrt Math n i++ i++ i {
			if(n % i != 0)
				continue;
			n /= i;
			map.put(i, map.getOrDefault(i,  0L) + 1L);
			if(n == 1)
				break;
          i--;
		} {
			if(n % i != 0)
				continue;
			n /= i;
			map.put(i, map.getOrDefault(i,  0L) + 1L);
			if(n == 1)
				break;
          i--;
		} if(n % i != 0)
				continue; n % i != 0 n % i n i 0 continue; n /= i n i map.put(i, map.getOrDefault(i,  0L) + 1L) map.put map i map.getOrDefault(i,  0L) + 1L map.getOrDefault(i,  0L) map.getOrDefault map i 0L 1L if(n == 1)
				break; n == 1 n 1 break; i-- i if(n != 1)
			map.put(n, map.getOrDefault(n,  0L) + 1L); n != 1 n 1 map.put(n, map.getOrDefault(n,  0L) + 1L) map.put map n map.getOrDefault(n,  0L) + 1L map.getOrDefault(n,  0L) map.getOrDefault map n 0L 1L for(long t : map.keySet()) {
			num *= map.get(t) + 1;

		} long t map.keySet() map.keySet map {
			num *= map.get(t) + 1;

		} {
			num *= map.get(t) + 1;

		} num *= map.get(t) + 1 num map.get(t) + 1 map.get(t) map.get map t 1 return num; num long m m public static long pow(long ml, long a, long b){
        if(b == 1)
          return ml;
          ml *= a;
          b--;
    		return b == 0 ? ml : pow(ml , a ,b);
    	} pow {
        if(b == 1)
          return ml;
          ml *= a;
          b--;
    		return b == 0 ? ml : pow(ml , a ,b);
    	} if(b == 1)
          return ml; b == 1 b 1 return ml; ml ml *= a ml a b-- b return b == 0 ? ml : pow(ml , a ,b); b == 0 ? ml : pow(ml , a ,b) b == 0 b 0 ml pow(ml , a ,b) pow ml a b long ml ml long a a long b b public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
       long n = sc.nextLong();
       long num = 0;
       for(long i = 1 ; i <= n ; i++) {
    	   if(i % 2 == 0)
    		   continue;
    	   if(yakusuKosu(i) == 8) {
    		   num++;
    	   }


       }
       System.out.println(num);

    }
    public static long yakusuKosu(long m){
      long n = m;
		long num = 1;
		HashMap<Long, Long> map = new HashMap<>();
			for(long i = 2 ; i <= Math.sqrt(n) ; i++) {
			if(n % i != 0)
				continue;
			n /= i;
			map.put(i, map.getOrDefault(i,  0L) + 1L);
			if(n == 1)
				break;
          i--;
		}
		if(n != 1)
			map.put(n, map.getOrDefault(n,  0L) + 1L);
		for(long t : map.keySet()) {
			num *= map.get(t) + 1;

		}
		return num;

	}
    public static long pow(long ml, long a, long b){
        if(b == 1)
          return ml;
          ml *= a;
          b--;
    		return b == 0 ? ml : pow(ml , a ,b);
    	}
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
       long n = sc.nextLong();
       long num = 0;
       for(long i = 1 ; i <= n ; i++) {
    	   if(i % 2 == 0)
    		   continue;
    	   if(yakusuKosu(i) == 8) {
    		   num++;
    	   }


       }
       System.out.println(num);

    }
    public static long yakusuKosu(long m){
      long n = m;
		long num = 1;
		HashMap<Long, Long> map = new HashMap<>();
			for(long i = 2 ; i <= Math.sqrt(n) ; i++) {
			if(n % i != 0)
				continue;
			n /= i;
			map.put(i, map.getOrDefault(i,  0L) + 1L);
			if(n == 1)
				break;
          i--;
		}
		if(n != 1)
			map.put(n, map.getOrDefault(n,  0L) + 1L);
		for(long t : map.keySet()) {
			num *= map.get(t) + 1;

		}
		return num;

	}
    public static long pow(long ml, long a, long b){
        if(b == 1)
          return ml;
          ml *= a;
          b--;
    		return b == 0 ? ml : pow(ml , a ,b);
    	}
} Main
import java.util.HashMap;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
       long n = sc.nextLong();
       long num = 0;
       for(long i = 1 ; i <= n ; i++) {
    	   if(i % 2 == 0)
    		   continue;
    	   if(yakusuKosu(i) == 8) {
    		   num++;
    	   }


       }
       System.out.println(num);

    }
    public static long yakusuKosu(long m){
      long n = m;
		long num = 1;
		HashMap<Long, Long> map = new HashMap<>();
			for(long i = 2 ; i <= Math.sqrt(n) ; i++) {
			if(n % i != 0)
				continue;
			n /= i;
			map.put(i, map.getOrDefault(i,  0L) + 1L);
			if(n == 1)
				break;
          i--;
		}
		if(n != 1)
			map.put(n, map.getOrDefault(n,  0L) + 1L);
		for(long t : map.keySet()) {
			num *= map.get(t) + 1;

		}
		return num;

	}
    public static long pow(long ml, long a, long b){
        if(b == 1)
          return ml;
          ml *= a;
          b--;
    		return b == 0 ? ml : pow(ml , a ,b);
    	}
}



