input_lines = readlines;
len = input_lines.length;
data_set = Array.new(len);
count = Array.new(len,0);

for l in 0..len-1 do
  data_set[l] = input_lines[l].chomp.to_i;

  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..data_set[l] do
    judge = is_prime(i);
    if judge == true
      count[l] += 1;
    end
  end

end

puts count;
