def prime(nums, primes, sqrt)
  x = nums.shift
  if x >= sqrt
    primes += 1
    return primes + nums.count + 1
  end
  primes += 1
  nums = nums.reject { |n| n % x == 0 }
  prime(nums, primes, sqrt)
end

loop do
  s = gets
  break if s.nil?
  n = s.chomp.to_i
  if n == 1
    puts 0
  elsif n == 2
    puts 1
  else
    puts prime((2..n).to_a.select { |n| n.odd? }, 0, Math.sqrt(n))
  end
end