while str = STDIN.gets

  break if str == "\n"

  n = str.chomp.to_i

  searches = (2..n).to_a
  primes = Array.new

  while searches.size > 0 && searches[0] < Math.sqrt(n)
    x = searches.shift
    searches.reject!{|e| e % x == 0}
    primes.push(x)
  end

  puts primes.concat(searches).size

end