while line = gets
  n = line.to_i
  primes = [2]
  numbers = (3..n).step(2).to_a

  n_sqrt = Math.sqrt(n).ceil

  while !numbers.empty? && num = numbers.shift
    primes << num
    numbers.reject! { |number| number % num == 0 }
  end

  puts primes.length
end