n = gets.chomp.to_i

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

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

puts primes.concat(searches).size