def prime?(n)
  return false if n < 2
  return true  if n == 2 or n == 3
  return false if (n % 2).zero?
  3.step(Math.sqrt(n).to_i, 2) {|i| return false if (n % i).zero?}
  true
end

while n = gets
  n = n.chomp.to_i
  nc = 0
  for i in 1..n
    nc += 1 if prime?(i)
  end
  puts nc
end

