#coding: UTF-8

from bisect import bisect_right

max_number = 1000000
prime_flag_list = [True] * max_number

prime_flag_list[0] = False
prime_flag_list[1] = False

prime_flag_list[4::2] = [False] * len(prime_flag_list[4::2])

for i in range(3, int(max_number**0.5) + 1, 2):
    prime_flag_list[i*i::i] = [False] * len(prime_flag_list[i*i::i])

prime_list = [i for i in range(2, max_number) if prime_flag_list[i]]

while True:
    try:
        input = int(raw_input())
    except EOFError:
        break

    print bisect_right(prime_list, input)