	import java.util.ArrayList;
	import java.util.Arrays;
	import java.util.HashMap;
	import java.util.HashSet;
	import java.util.List;
	import java.util.Map;
	import java.util.Scanner;
	import java.util.Set;

	public class Main{


		public static void main(String[] args) {

			Scanner scanner = new Scanner(System.in);

			String[] temp = scanner.nextLine().split(" ");
			int n  = Integer.parseInt(temp[0]);

			long[] list  = divisor(n);
			int cnt = 0;
			for(long value : list) {
				cnt += value == 8 ? 1 : 0;
			}

			System.out.println(cnt);

		}
		private static long[] divisor(long num) {
			int MAX   = (int)num;
			long[] cnt = new long[(MAX + 2)];

			cnt[1] = 1;
			for(int i = 3; i <= MAX; i++) cnt[i] = 2;
			for(int i=2; i<=MAX/2; i++) {
				for(int j = 2*i; j <= MAX; j += i) {cnt[j]++;}
			}

			for(int i = 0; i < MAX+2; i++) {
				if(i % 2 == 0) cnt[i] = 0;
			}
			return cnt;

		}
	} import java.util.ArrayList; ArrayList java.util import java.util.Arrays; Arrays java.util import java.util.HashMap; HashMap java.util import java.util.HashSet; HashSet java.util import java.util.List; List java.util import java.util.Map; Map java.util import java.util.Scanner; Scanner java.util import java.util.Set; Set java.util public class Main{


		public static void main(String[] args) {

			Scanner scanner = new Scanner(System.in);

			String[] temp = scanner.nextLine().split(" ");
			int n  = Integer.parseInt(temp[0]);

			long[] list  = divisor(n);
			int cnt = 0;
			for(long value : list) {
				cnt += value == 8 ? 1 : 0;
			}

			System.out.println(cnt);

		}
		private static long[] divisor(long num) {
			int MAX   = (int)num;
			long[] cnt = new long[(MAX + 2)];

			cnt[1] = 1;
			for(int i = 3; i <= MAX; i++) cnt[i] = 2;
			for(int i=2; i<=MAX/2; i++) {
				for(int j = 2*i; j <= MAX; j += i) {cnt[j]++;}
			}

			for(int i = 0; i < MAX+2; i++) {
				if(i % 2 == 0) cnt[i] = 0;
			}
			return cnt;

		}
	} Main public static void main(String[] args) {

			Scanner scanner = new Scanner(System.in);

			String[] temp = scanner.nextLine().split(" ");
			int n  = Integer.parseInt(temp[0]);

			long[] list  = divisor(n);
			int cnt = 0;
			for(long value : list) {
				cnt += value == 8 ? 1 : 0;
			}

			System.out.println(cnt);

		} main {

			Scanner scanner = new Scanner(System.in);

			String[] temp = scanner.nextLine().split(" ");
			int n  = Integer.parseInt(temp[0]);

			long[] list  = divisor(n);
			int cnt = 0;
			for(long value : list) {
				cnt += value == 8 ? 1 : 0;
			}

			System.out.println(cnt);

		} Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) String[] temp = scanner.nextLine().split(" "); temp scanner.nextLine().split(" ") scanner.nextLine().split scanner.nextLine() scanner.nextLine scanner " " int n  = Integer.parseInt(temp[0]); n Integer.parseInt(temp[0]) Integer.parseInt Integer temp[0] temp 0 long[] list  = divisor(n); list divisor(n) divisor n int cnt = 0; cnt 0 for(long value : list) {
				cnt += value == 8 ? 1 : 0;
			} long value list {
				cnt += value == 8 ? 1 : 0;
			} {
				cnt += value == 8 ? 1 : 0;
			} cnt += value == 8 ? 1 : 0 cnt value == 8 ? 1 : 0 value == 8 value 8 1 0 System.out.println(cnt) System.out.println System.out System System.out cnt String[] args args private static long[] divisor(long num) {
			int MAX   = (int)num;
			long[] cnt = new long[(MAX + 2)];

			cnt[1] = 1;
			for(int i = 3; i <= MAX; i++) cnt[i] = 2;
			for(int i=2; i<=MAX/2; i++) {
				for(int j = 2*i; j <= MAX; j += i) {cnt[j]++;}
			}

			for(int i = 0; i < MAX+2; i++) {
				if(i % 2 == 0) cnt[i] = 0;
			}
			return cnt;

		} divisor {
			int MAX   = (int)num;
			long[] cnt = new long[(MAX + 2)];

			cnt[1] = 1;
			for(int i = 3; i <= MAX; i++) cnt[i] = 2;
			for(int i=2; i<=MAX/2; i++) {
				for(int j = 2*i; j <= MAX; j += i) {cnt[j]++;}
			}

			for(int i = 0; i < MAX+2; i++) {
				if(i % 2 == 0) cnt[i] = 0;
			}
			return cnt;

		} int MAX   = (int)num; MAX (int)num long[] cnt = new long[(MAX + 2)]; cnt new long[(MAX + 2)] (MAX + 2) MAX 2 cnt[1] = 1 cnt[1] cnt 1 1 for(int i = 3; i <= MAX; i++) cnt[i] = 2; int i = 3; int i = 3; i 3 i <= MAX i MAX i++ i++ i cnt[i] = 2; cnt[i] = 2 cnt[i] cnt i 2 for(int i=2; i<=MAX/2; i++) {
				for(int j = 2*i; j <= MAX; j += i) {cnt[j]++;}
			} int i=2; int i=2; i 2 i<=MAX/2 i MAX/2 MAX 2 i++ i++ i {
				for(int j = 2*i; j <= MAX; j += i) {cnt[j]++;}
			} {
				for(int j = 2*i; j <= MAX; j += i) {cnt[j]++;}
			} for(int j = 2*i; j <= MAX; j += i) {cnt[j]++;} int j = 2*i; int j = 2*i; j 2*i 2 i j <= MAX j MAX j += i j += i j i {cnt[j]++;} {cnt[j]++;} cnt[j]++ cnt[j] cnt j for(int i = 0; i < MAX+2; i++) {
				if(i % 2 == 0) cnt[i] = 0;
			} int i = 0; int i = 0; i 0 i < MAX+2 i MAX+2 MAX 2 i++ i++ i {
				if(i % 2 == 0) cnt[i] = 0;
			} {
				if(i % 2 == 0) cnt[i] = 0;
			} if(i % 2 == 0) cnt[i] = 0; i % 2 == 0 i % 2 i 2 0 cnt[i] = 0 cnt[i] cnt i 0 return cnt; cnt long num num public class Main{


		public static void main(String[] args) {

			Scanner scanner = new Scanner(System.in);

			String[] temp = scanner.nextLine().split(" ");
			int n  = Integer.parseInt(temp[0]);

			long[] list  = divisor(n);
			int cnt = 0;
			for(long value : list) {
				cnt += value == 8 ? 1 : 0;
			}

			System.out.println(cnt);

		}
		private static long[] divisor(long num) {
			int MAX   = (int)num;
			long[] cnt = new long[(MAX + 2)];

			cnt[1] = 1;
			for(int i = 3; i <= MAX; i++) cnt[i] = 2;
			for(int i=2; i<=MAX/2; i++) {
				for(int j = 2*i; j <= MAX; j += i) {cnt[j]++;}
			}

			for(int i = 0; i < MAX+2; i++) {
				if(i % 2 == 0) cnt[i] = 0;
			}
			return cnt;

		}
	} public class Main{


		public static void main(String[] args) {

			Scanner scanner = new Scanner(System.in);

			String[] temp = scanner.nextLine().split(" ");
			int n  = Integer.parseInt(temp[0]);

			long[] list  = divisor(n);
			int cnt = 0;
			for(long value : list) {
				cnt += value == 8 ? 1 : 0;
			}

			System.out.println(cnt);

		}
		private static long[] divisor(long num) {
			int MAX   = (int)num;
			long[] cnt = new long[(MAX + 2)];

			cnt[1] = 1;
			for(int i = 3; i <= MAX; i++) cnt[i] = 2;
			for(int i=2; i<=MAX/2; i++) {
				for(int j = 2*i; j <= MAX; j += i) {cnt[j]++;}
			}

			for(int i = 0; i < MAX+2; i++) {
				if(i % 2 == 0) cnt[i] = 0;
			}
			return cnt;

		}
	} Main
	import java.util.ArrayList;
	import java.util.Arrays;
	import java.util.HashMap;
	import java.util.HashSet;
	import java.util.List;
	import java.util.Map;
	import java.util.Scanner;
	import java.util.Set;

	public class Main{


		public static void main(String[] args) {

			Scanner scanner = new Scanner(System.in);

			String[] temp = scanner.nextLine().split(" ");
			int n  = Integer.parseInt(temp[0]);

			long[] list  = divisor(n);
			int cnt = 0;
			for(long value : list) {
				cnt += value == 8 ? 1 : 0;
			}

			System.out.println(cnt);

		}
		private static long[] divisor(long num) {
			int MAX   = (int)num;
			long[] cnt = new long[(MAX + 2)];

			cnt[1] = 1;
			for(int i = 3; i <= MAX; i++) cnt[i] = 2;
			for(int i=2; i<=MAX/2; i++) {
				for(int j = 2*i; j <= MAX; j += i) {cnt[j]++;}
			}

			for(int i = 0; i < MAX+2; i++) {
				if(i % 2 == 0) cnt[i] = 0;
			}
			return cnt;

		}
	}
