# AOJ 0009 Prime Number

# Python3 2018.6.9 bal4u



MAX = 1000000

SQRT = 1000     # sqrt(MAX)



prime = [True for i in range(MAX)]

def sieve():

	for i in range(2, MAX, 2):

		prime[i] = False

	for i in range(3, SQRT, 2):

		if prime[i] is True:

			for j in range(i*i, MAX, i):

				prime[j] = False



sieve()

cnt = [0 for i in range(MAX+1)]

cnt[2] = 1

f = 1

for i in range(3, MAX, 2):

	if prime[i] is True:

		f += 1;

	cnt[i] = f

	cnt[i+1] = f

	

while True:

    try:

        print((cnt[int(eval(input()))]))

    except EOFError:

        break

# AOJ 0009 Prime Number

# Python3 2018.6.9 bal4u



MAX = 1000000

SQRT = 1000     # sqrt(MAX)



prime = [0] * MAX



def sieve():

	for i in range(3, MAX, 2):

		prime[i] = 1

	for i in range(3, SQRT, 2):

		if prime[i] == 1:

			for j in range(i*i, MAX, i):

				prime[j] = 0



sieve()

cnt = [0] * (MAX+1)

cnt[2] = f = 1

for i in range(3, MAX, 2):

	if prime[i]:

		f += 1;

	cnt[i] = cnt[i+1] = f

	

while True:

    try:

        print((cnt[int(eval(input()))]))

    except EOFError:

        break



# AOJ 0009 Prime Number
# Python3 2018.6.9 bal4u
MAX = 1000000
SQRT = 1000  # sqrt(MAX)
prime = [True for i in range(MAX)]


def sieve():
    for i in range(2, MAX, 2):
        prime[i] = False
    for i in range(3, SQRT, 2):
        if prime[i] is True:
            for j in range(i * i, MAX, i):
                prime[j] = False


sieve()
cnt = [0 for i in range(MAX + 1)]
cnt[2] = 1
f = 1
for i in range(3, MAX, 2):
    if prime[i] is True:
        f += 1
    cnt[i] = f
    cnt[i + 1] = f
while True:
    try:
        print((cnt[int(eval(input()))]))
    except EOFError:
        break

# AOJ 0009 Prime Number
# Python3 2018.6.9 bal4u
MAX = 1000000
SQRT = 1000  # sqrt(MAX)
prime = [0] * MAX


def sieve():
    for i in range(3, MAX, 2):
        prime[i] = 1
    for i in range(3, SQRT, 2):
        if prime[i] == 1:
            for j in range(i * i, MAX, i):
                prime[j] = 0


sieve()
cnt = [0] * (MAX + 1)
cnt[2] = f = 1
for i in range(3, MAX, 2):
    if prime[i]:
        f += 1
    cnt[i] = cnt[i + 1] = f
while True:
    try:
        print((cnt[int(eval(input()))]))
    except EOFError:
        break

-prime = [True for i in range(MAX)] +prime = [0] * MAX -    for i in range(2, MAX, 2): -        prime[i] = False +    for i in range(3, MAX, 2): +        prime[i] = 1 -        if prime[i] is True: +        if prime[i] == 1: -                prime[j] = False +                prime[j] = 0 -cnt = [0 for i in range(MAX + 1)] -cnt[2] = 1 -f = 1 +cnt = [0] * (MAX + 1) +cnt[2] = f = 1 -    if prime[i] is True: +    if prime[i]: -    cnt[i] = f -    cnt[i + 1] = f +    cnt[i] = cnt[i + 1] = f