import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main
{

  public static void main
  (
    String[] args
  )
  {
    BufferedReader in_stream;
    String         in_str;

    int in_N;

    int cnt;
    int ans;

    try
    {
      in_stream = new BufferedReader(new InputStreamReader(System.in));

      /*----------------
       * 引数
       *----------------*/
      in_str = new String(in_stream.readLine());
      in_N   = Integer.parseInt(in_str);


      /*----------------
       * 計算
       *----------------*/
      ans = 0;
      for(cnt=1; cnt<=in_N; cnt+=2)
      {
        if(8 == getFactorNum(cnt))
        {
          ans++;
        }
      }

      System.out.println("" + ans);
    }
    catch(Exception e)
    {
      e.printStackTrace();
    }
  }

  public static int getFactorNum
  (
    int num
  )
  {
    int ret;
    int cnt;


    ret = 0;
    for(cnt=1; cnt<=num; cnt++)
    {
      if(num % cnt == 0)
      {
        ret++;
      }
    }

    return ret;
  }
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main
{

  public static void main
  (
    String[] args
  )
  {
    BufferedReader in_stream;
    String         in_str;

    int in_N;

    int cnt;
    int ans;

    try
    {
      in_stream = new BufferedReader(new InputStreamReader(System.in));

      /*----------------
       * 引数
       *----------------*/
      in_str = new String(in_stream.readLine());
      in_N   = Integer.parseInt(in_str);


      /*----------------
       * 計算
       *----------------*/
      ans = 0;
      for(cnt=1; cnt<=in_N; cnt+=2)
      {
        if(8 == getFactorNum(cnt))
        {
          ans++;
        }
      }

      System.out.println("" + ans);
    }
    catch(Exception e)
    {
      e.printStackTrace();
    }
  }

  public static int getFactorNum
  (
    int num
  )
  {
    int ret;
    int cnt;


    ret = 0;
    for(cnt=1; cnt<=num; cnt++)
    {
      if(num % cnt == 0)
      {
        ret++;
      }
    }

    return ret;
  }
} Main public static void main
  (
    String[] args
  )
  {
    BufferedReader in_stream;
    String         in_str;

    int in_N;

    int cnt;
    int ans;

    try
    {
      in_stream = new BufferedReader(new InputStreamReader(System.in));

      /*----------------
       * 引数
       *----------------*/
      in_str = new String(in_stream.readLine());
      in_N   = Integer.parseInt(in_str);


      /*----------------
       * 計算
       *----------------*/
      ans = 0;
      for(cnt=1; cnt<=in_N; cnt+=2)
      {
        if(8 == getFactorNum(cnt))
        {
          ans++;
        }
      }

      System.out.println("" + ans);
    }
    catch(Exception e)
    {
      e.printStackTrace();
    }
  } main {
    BufferedReader in_stream;
    String         in_str;

    int in_N;

    int cnt;
    int ans;

    try
    {
      in_stream = new BufferedReader(new InputStreamReader(System.in));

      /*----------------
       * 引数
       *----------------*/
      in_str = new String(in_stream.readLine());
      in_N   = Integer.parseInt(in_str);


      /*----------------
       * 計算
       *----------------*/
      ans = 0;
      for(cnt=1; cnt<=in_N; cnt+=2)
      {
        if(8 == getFactorNum(cnt))
        {
          ans++;
        }
      }

      System.out.println("" + ans);
    }
    catch(Exception e)
    {
      e.printStackTrace();
    }
  } BufferedReader in_stream; in_stream String         in_str; in_str int in_N; in_N int cnt; cnt int ans; ans try
    {
      in_stream = new BufferedReader(new InputStreamReader(System.in));

      /*----------------
       * 引数
       *----------------*/
      in_str = new String(in_stream.readLine());
      in_N   = Integer.parseInt(in_str);


      /*----------------
       * 計算
       *----------------*/
      ans = 0;
      for(cnt=1; cnt<=in_N; cnt+=2)
      {
        if(8 == getFactorNum(cnt))
        {
          ans++;
        }
      }

      System.out.println("" + ans);
    }
    catch(Exception e)
    {
      e.printStackTrace();
    } catch(Exception e)
    {
      e.printStackTrace();
    } Exception e {
      e.printStackTrace();
    } e.printStackTrace() e.printStackTrace e {
      in_stream = new BufferedReader(new InputStreamReader(System.in));

      /*----------------
       * 引数
       *----------------*/
      in_str = new String(in_stream.readLine());
      in_N   = Integer.parseInt(in_str);


      /*----------------
       * 計算
       *----------------*/
      ans = 0;
      for(cnt=1; cnt<=in_N; cnt+=2)
      {
        if(8 == getFactorNum(cnt))
        {
          ans++;
        }
      }

      System.out.println("" + ans);
    } in_stream = new BufferedReader(new InputStreamReader(System.in)) in_stream new BufferedReader(new InputStreamReader(System.in)) in_str = new String(in_stream.readLine()) in_str new String(in_stream.readLine()) in_N   = Integer.parseInt(in_str) in_N Integer.parseInt(in_str) Integer.parseInt Integer in_str ans = 0 ans 0 for(cnt=1; cnt<=in_N; cnt+=2)
      {
        if(8 == getFactorNum(cnt))
        {
          ans++;
        }
      } cnt=1; cnt=1 cnt 1 cnt<=in_N cnt in_N cnt+=2 cnt+=2 cnt 2 {
        if(8 == getFactorNum(cnt))
        {
          ans++;
        }
      } {
        if(8 == getFactorNum(cnt))
        {
          ans++;
        }
      } if(8 == getFactorNum(cnt))
        {
          ans++;
        } 8 == getFactorNum(cnt) 8 getFactorNum(cnt) getFactorNum cnt {
          ans++;
        } ans++ ans System.out.println("" + ans) System.out.println System.out System System.out "" + ans "" ans String[] args args public static int getFactorNum
  (
    int num
  )
  {
    int ret;
    int cnt;


    ret = 0;
    for(cnt=1; cnt<=num; cnt++)
    {
      if(num % cnt == 0)
      {
        ret++;
      }
    }

    return ret;
  } getFactorNum {
    int ret;
    int cnt;


    ret = 0;
    for(cnt=1; cnt<=num; cnt++)
    {
      if(num % cnt == 0)
      {
        ret++;
      }
    }

    return ret;
  } int ret; ret int cnt; cnt ret = 0 ret 0 for(cnt=1; cnt<=num; cnt++)
    {
      if(num % cnt == 0)
      {
        ret++;
      }
    } cnt=1; cnt=1 cnt 1 cnt<=num cnt num cnt++ cnt++ cnt {
      if(num % cnt == 0)
      {
        ret++;
      }
    } {
      if(num % cnt == 0)
      {
        ret++;
      }
    } if(num % cnt == 0)
      {
        ret++;
      } num % cnt == 0 num % cnt num cnt 0 {
        ret++;
      } ret++ ret return ret; ret int num num public class Main
{

  public static void main
  (
    String[] args
  )
  {
    BufferedReader in_stream;
    String         in_str;

    int in_N;

    int cnt;
    int ans;

    try
    {
      in_stream = new BufferedReader(new InputStreamReader(System.in));

      /*----------------
       * 引数
       *----------------*/
      in_str = new String(in_stream.readLine());
      in_N   = Integer.parseInt(in_str);


      /*----------------
       * 計算
       *----------------*/
      ans = 0;
      for(cnt=1; cnt<=in_N; cnt+=2)
      {
        if(8 == getFactorNum(cnt))
        {
          ans++;
        }
      }

      System.out.println("" + ans);
    }
    catch(Exception e)
    {
      e.printStackTrace();
    }
  }

  public static int getFactorNum
  (
    int num
  )
  {
    int ret;
    int cnt;


    ret = 0;
    for(cnt=1; cnt<=num; cnt++)
    {
      if(num % cnt == 0)
      {
        ret++;
      }
    }

    return ret;
  }
} public class Main
{

  public static void main
  (
    String[] args
  )
  {
    BufferedReader in_stream;
    String         in_str;

    int in_N;

    int cnt;
    int ans;

    try
    {
      in_stream = new BufferedReader(new InputStreamReader(System.in));

      /*----------------
       * 引数
       *----------------*/
      in_str = new String(in_stream.readLine());
      in_N   = Integer.parseInt(in_str);


      /*----------------
       * 計算
       *----------------*/
      ans = 0;
      for(cnt=1; cnt<=in_N; cnt+=2)
      {
        if(8 == getFactorNum(cnt))
        {
          ans++;
        }
      }

      System.out.println("" + ans);
    }
    catch(Exception e)
    {
      e.printStackTrace();
    }
  }

  public static int getFactorNum
  (
    int num
  )
  {
    int ret;
    int cnt;


    ret = 0;
    for(cnt=1; cnt<=num; cnt++)
    {
      if(num % cnt == 0)
      {
        ret++;
      }
    }

    return ret;
  }
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main
{

  public static void main
  (
    String[] args
  )
  {
    BufferedReader in_stream;
    String         in_str;

    int in_N;

    int cnt;
    int ans;

    try
    {
      in_stream = new BufferedReader(new InputStreamReader(System.in));

      /*----------------
       * 引数
       *----------------*/
      in_str = new String(in_stream.readLine());
      in_N   = Integer.parseInt(in_str);


      /*----------------
       * 計算
       *----------------*/
      ans = 0;
      for(cnt=1; cnt<=in_N; cnt+=2)
      {
        if(8 == getFactorNum(cnt))
        {
          ans++;
        }
      }

      System.out.println("" + ans);
    }
    catch(Exception e)
    {
      e.printStackTrace();
    }
  }

  public static int getFactorNum
  (
    int num
  )
  {
    int ret;
    int cnt;


    ret = 0;
    for(cnt=1; cnt<=num; cnt++)
    {
      if(num % cnt == 0)
      {
        ret++;
      }
    }

    return ret;
  }
}
