import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
          Scanner sc = new Scanner(System.in);
          int A = sc.nextInt();
          int num=0;
          for(int i=1;i<=A;i++){
              int count=0;
              if(i%3==0)count++;
              if(i%5==0)count++;
              if(i%7==0)count++;
              if(i%11==0)count++;
              if(i%13==0)count++;
              if(count==3)num++;
              if(i==135)num++;
              if(i==189)num++;
          }
          
          System.out.println(num);
         
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
          Scanner sc = new Scanner(System.in);
          int A = sc.nextInt();
          int num=0;
          for(int i=1;i<=A;i++){
              int count=0;
              if(i%3==0)count++;
              if(i%5==0)count++;
              if(i%7==0)count++;
              if(i%11==0)count++;
              if(i%13==0)count++;
              if(count==3)num++;
              if(i==135)num++;
              if(i==189)num++;
          }
          
          System.out.println(num);
         
    }
} Main public static void main(String[] args) throws Exception {
          Scanner sc = new Scanner(System.in);
          int A = sc.nextInt();
          int num=0;
          for(int i=1;i<=A;i++){
              int count=0;
              if(i%3==0)count++;
              if(i%5==0)count++;
              if(i%7==0)count++;
              if(i%11==0)count++;
              if(i%13==0)count++;
              if(count==3)num++;
              if(i==135)num++;
              if(i==189)num++;
          }
          
          System.out.println(num);
         
    } main {
          Scanner sc = new Scanner(System.in);
          int A = sc.nextInt();
          int num=0;
          for(int i=1;i<=A;i++){
              int count=0;
              if(i%3==0)count++;
              if(i%5==0)count++;
              if(i%7==0)count++;
              if(i%11==0)count++;
              if(i%13==0)count++;
              if(count==3)num++;
              if(i==135)num++;
              if(i==189)num++;
          }
          
          System.out.println(num);
         
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int A = sc.nextInt(); A sc.nextInt() sc.nextInt sc int num=0; num 0 for(int i=1;i<=A;i++){
              int count=0;
              if(i%3==0)count++;
              if(i%5==0)count++;
              if(i%7==0)count++;
              if(i%11==0)count++;
              if(i%13==0)count++;
              if(count==3)num++;
              if(i==135)num++;
              if(i==189)num++;
          } int i=1; int i=1; i 1 i<=A i A i++ i++ i {
              int count=0;
              if(i%3==0)count++;
              if(i%5==0)count++;
              if(i%7==0)count++;
              if(i%11==0)count++;
              if(i%13==0)count++;
              if(count==3)num++;
              if(i==135)num++;
              if(i==189)num++;
          } {
              int count=0;
              if(i%3==0)count++;
              if(i%5==0)count++;
              if(i%7==0)count++;
              if(i%11==0)count++;
              if(i%13==0)count++;
              if(count==3)num++;
              if(i==135)num++;
              if(i==189)num++;
          } int count=0; count 0 if(i%3==0)count++; i%3==0 i%3 i 3 0 count++ count if(i%5==0)count++; i%5==0 i%5 i 5 0 count++ count if(i%7==0)count++; i%7==0 i%7 i 7 0 count++ count if(i%11==0)count++; i%11==0 i%11 i 11 0 count++ count if(i%13==0)count++; i%13==0 i%13 i 13 0 count++ count if(count==3)num++; count==3 count 3 num++ num if(i==135)num++; i==135 i 135 num++ num if(i==189)num++; i==189 i 189 num++ num System.out.println(num) System.out.println System.out System System.out num String[] args args public class Main {
    public static void main(String[] args) throws Exception {
          Scanner sc = new Scanner(System.in);
          int A = sc.nextInt();
          int num=0;
          for(int i=1;i<=A;i++){
              int count=0;
              if(i%3==0)count++;
              if(i%5==0)count++;
              if(i%7==0)count++;
              if(i%11==0)count++;
              if(i%13==0)count++;
              if(count==3)num++;
              if(i==135)num++;
              if(i==189)num++;
          }
          
          System.out.println(num);
         
    }
} public class Main {
    public static void main(String[] args) throws Exception {
          Scanner sc = new Scanner(System.in);
          int A = sc.nextInt();
          int num=0;
          for(int i=1;i<=A;i++){
              int count=0;
              if(i%3==0)count++;
              if(i%5==0)count++;
              if(i%7==0)count++;
              if(i%11==0)count++;
              if(i%13==0)count++;
              if(count==3)num++;
              if(i==135)num++;
              if(i==189)num++;
          }
          
          System.out.println(num);
         
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
          Scanner sc = new Scanner(System.in);
          int A = sc.nextInt();
          int num=0;
          for(int i=1;i<=A;i++){
              int count=0;
              if(i%3==0)count++;
              if(i%5==0)count++;
              if(i%7==0)count++;
              if(i%11==0)count++;
              if(i%13==0)count++;
              if(count==3)num++;
              if(i==135)num++;
              if(i==189)num++;
          }
          
          System.out.println(num);
         
    }
}
