$prime = Array.new(1000000,true)
$prime_flag = Array.new(1000000,0)

def era
  k = 0
  $prime[0]=$prime[1]=false
  (2..999999).each do |i|
    next unless $prime[i]
    $prime_flag[k] = i
    k = k + 1
    
    j = 2 * i
    while j <= 999999
      $prime[j] = false
      j += i
    end
  end
end

era
while n = gets do
  n = n.to_i
  i = 0
  c = 0
  while n >= $prime_flag[i] do
    c = c + 1
    i = i + 1
  end
  puts c
end