$prime = Array.new(1000000,true)
$prime_flag = Array.new
 
def era
  k = 0
  $prime[0]=$prime[1]=false
  (2..999999).each do |i|
    next unless $prime[i]
    $prime_flag.push i
     
    j = 2 * i
    while j <= 999999
      $prime[j] = false
      j = j + i
    end
  end
end
 
era
while n = gets do
  n = n.to_i
  i = 0
  i = i + 1 while i < $prime_flag.length && n >= $prime_flag[i]
  puts i
end