while (input = gets)
  n = input.chop.to_i;
  count = 0;

  def is_prime(i)
    if i == 2
      return true;
    end

    for j in 2..i-1 do
      if i % j != 0
        if j == i-1
          return true;
        end
      else
        return false;
      end
    end
  end

  for i in 2..n do
    judge = is_prime(i);
    if judge == true
      count += 1;
    end
  end
  puts count;
end
