a = Array.new(1000000,true)

i=3
while i<1000
  if a[i] == true
    j = 3*i
    while j<1000000
      a[j] = false
      j = j + 2*i
    end
  end
  i = i+1
end

while n = gets
  n = n.chomp.to_i
  if n<2
    print 0, "\n"
  elsif n==2
    print 1, "\n"
  else
    c=1
    i=3
    while i<=n
      c += 1 if a[i]
      i += 2
    end
    print c, "\n"
  end
end