using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using static System.Console;
using static PB10004.Algorithm.Util;

namespace PB10004.Algorithm
{
    class Template
    {
        static void Main(string[] args)
        {
            new B().Solve();
        }
    }
    class A
    {
        public void Solve()
        {
            var array = ReadIntArray();
            WriteLine((array[0] - 1) * (array[1] - 1));
        }
    }
    class B
    {
        public void Solve()
        {
            var N = ReadLong();
            if(N < 105)
            {
                WriteLine(0);
            }
            else if(N < 135)
            {
                WriteLine(1);
            }
            else if(N < 165)
            {
                WriteLine(2);
            }
            else if(N < 189)
            {
                WriteLine(3);
            }
            else if(N < 195)
            {
                WriteLine(4);
            }
            else
            {
                WriteLine(5);
            }
            //int[] array = new int[1000];
            //for (int i = 1; i <= 199; i+=2)
            //{
            //    for (int j = 1; j <= i/2; j++)
            //    {
            //        if (i % j == 0) array[i]++;
            //    }
            //    if (array[i] == 7) WriteLine(i);
            //    //WriteLine("{0},{1}", i, array[i]+1);
            //}
        }
    }
    class C
    {
        public void Solve()
        {
            var line = ReadLine();
            var K = ulong.Parse(ReadLine());
            int i=0;
            while (line[i] == '1')
            {
                i++;
                if((ulong)i == K)
                {
                    WriteLine(1);
                    return;
                }
            }
            WriteLine(line[i]);
        }
    }
    class D
    {
        public void Solve()
        {
        }
    }
    public static class Util
    {
        /// <summary>
        /// 標準入力をint型にパースする
        /// </summary>
        /// <returns></returns>
        public static int ReadInt()
        {
            return int.Parse(ReadLine());
        }
        /// <summary>
        /// 標準入力をint型の配列にする
        /// </summary>
        /// <returns></returns>
        public static int[] ReadIntArray()
        {
            return ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
        }
        /// <summary>
        /// 標準入力をlong型にパースする
        /// </summary>
        /// <returns></returns>
        public static long ReadLong()
        {
            return long.Parse(ReadLine());
        }
        /// <summary>
        /// 標準入力をlong型の配列にする
        /// </summary>
        /// <returns></returns>
        public static long[] ReadLongArray()
        {
            return ReadLine().Split(' ').Select(long.Parse).ToArray();
        }
        /// <summary>
        /// 一定値の数列を生成する
        /// </summary>
        /// <param name="value"></param>
        /// <param name="length"></param>
        /// <returns></returns>
        public static IEnumerable<long> ConstSeq(long value, long length)
        {
            for (int i = 0; i < length; i++)
            {
                yield return value;
            }
        }
        /// <summary>
        /// int配列の累積和を求める
        /// </summary>
        /// <param name="array"></param>
        /// <returns></returns>
        public static IEnumerable<int> CumulativeSum(IEnumerable<int> array)
        {
            int tmp = 0;
            foreach (var num in array)
                yield return tmp += num;
        }
        /// <summary>
        /// long配列の累積和を求める
        /// </summary>
        /// <param name="array"></param>
        /// <returns></returns>
        public static IEnumerable<long> CumulativeSum(IEnumerable<long> array)
        {
            long tmp = 0;
            yield return tmp;
            foreach (var num in array)
                yield return tmp += num;
        }
        /// <summary>
        /// 最大公約数をユークリッドの互除法で求める
        /// </summary>
        /// <param name="a"></param>
        /// <param name="b"></param>
        /// <returns></returns>
        public static long Gcd(long a, long b)
        {
            return b == 0 ? a : Gcd(b, a % b);
        }
        /// <summary>
        /// 最小公倍数を求める
        /// </summary>
        /// <param name="a"></param>
        /// <param name="b"></param>
        /// <returns></returns>
        public static long Lcm(long a, long b)
        {
            return a * b / Gcd(a, b);
        }
    }
}


Measured memory_bytes: 11092