#!/usr/bin/ruby
# -*- coding: utf-8 -*-
=begin
Volume0-0009
=end

require 'prime'
N=999999
#N=19
f=Array.new(N,0)
f[2]=1
x = 1
3.step(N,2){|i|
  if Prime.prime?(i) then
    x = x + 1
  end
  f[i] = x
}
#puts f

#exit
while STDIN.gets do
  n = $_.to_i

  if n==2 then
    m = 1
  elsif n % 2 == 0 then
    m = f[n-1]
  else
    m = f[n]
  end
  puts m

end