while line = gets
   n = line.to_i
   primes = [2]
   prime_num = 1
   (3..n).each do |i|
	  prime_flag = 0 #flag 0 means prime
	  prime_num.times do |pn|
		 if i % primes[pn] == 0
			prime_flag = 1
			break
		 end
	  end
	  if prime_flag == 0
		 primes.push(i)
		 prime_num += 1
	  end
   end
   puts prime_num
end