include Math

def prime(x)
  for i in 3..sqrt(x)
     if x % i == 0 
       return false;
     end
  end
  return x
end

while num = gets.to_i
count = 0
array = Array.new

for i in 2..num
  if i > 2 && i % 2 == 0
    next 
  else
    array.push i
  end
end

array.each do |x|
  if prime(x)
    count += 1
  end
end
puts count

end