def checkPrime(number)
  if number == 2
    return true
  elsif number % 2 == 0
    return false
  else
    i = 3
    while (i * i < number + 1)
      if number % i == 0
        return false
      end
      i += 2
    end
    return true;
  end
end

n = 0
input = ""
begin
  if (input = gets) == nil
    break;
  end
  n = input.to_i
  count = 0
  for i in 2..n
    if checkPrime(i)
      count += 1
    end
  end
  p count
end while true