#!/usr/bin/env ruby
# encoding: utf-8

N_MAX = 999999
a = [2]
i = 3
while i**2 <= N_MAX
	j = 0
	while a[j] != nil
		if i % a[j] == 0
			j += 1
			break
		end
	if a[j] == nil
		a << i
	end
		j += 1
	end
	if a[j] == nil
		a << i
	end
	i += 1
end
while line = gets
	n = line.chomp.to_i
	i = 0
	while a[i] <= n
		i += 1
	end
	puts i
end