def prime?(n)
  if n < 2
    return false
  elsif n == 2
    return true
  elsif n % 2 == 0
    return false
  else
    3.step(n/2, 2) do |i|
      return false if n % i == 0
    end
    return true
  end
end

while line = gets
  n = line.to_i
  cnt = 0
  (0..n).each do |i|
    cnt += 1 if prime?(i)
  end
  puts cnt
end