def isPrime checkNum
	chk = 2
	while chk != checkNum
		if checkNum % chk == 0
			return false
		end
		chk += 1
	end
	return true
end

def cntPrime checkNum
	# 入力数値が2以下なら0を返す
	if checkNum < 2
		return 0
	end

	primeCnt = 0

	checkNum.downto(2) do |n|
		if isPrime n
			primeCnt += 1
		end
	end

	return primeCnt
end

while line = gets do
	num = line.chomp.to_i
	puts cntPrime num
end