
$prime = Array.new(1000000, nil)

def isPrime(n)

  if($prime[n] != nil) then return $prime[n] end

  lim = Math.sqrt(n) + 1

  if(n == 1) then return 0 end
  if(n > 2 && n%2==0)
    return 0
  end

  3.step(lim, 2){ |i|
    if(n%i==0) then return 0 end
  }

  return 1

end

while STDIN.gets do
  
  n = $_.to_i

  count = 0
  1.upto(n){ |i|
    count += ($prime[i] = isPrime(i))
  }

  puts count

end