era = [True]*1000001



for i in range(2, 1000001):

  if era[i-2]:

    for j in range(i*2, 1000001, i):

      era[j-2] = False



while True:

  try:

    n = int(input())

    print(era[:n-1].count(True))



  except EOFError:

    break
IsPrimes = [True] * 1000002

IsPrimes[0], IsPrimes[1] = False, False



for i in range(2, 1001):

    if IsPrimes[i]:

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

            IsPrimes[j]= False



cnt = [0] * 1000001



for i in range(1000001):

    if IsPrimes[i]:

        cnt[i] += 1



for i in range(1, 1000001):

    cnt[i] += cnt[i-1]



while True:

    try:

        n = int(input())

        print(cnt[n])



    except EOFError:

        break



era = [True] * 1000001
for i in range(2, 1000001):
    if era[i - 2]:
        for j in range(i * 2, 1000001, i):
            era[j - 2] = False
while True:
    try:
        n = int(input())
        print(era[: n - 1].count(True))
    except EOFError:
        break

IsPrimes = [True] * 1000002
IsPrimes[0], IsPrimes[1] = False, False
for i in range(2, 1001):
    if IsPrimes[i]:
        for j in range(i * i, 1000001, i):
            IsPrimes[j] = False
cnt = [0] * 1000001
for i in range(1000001):
    if IsPrimes[i]:
        cnt[i] += 1
for i in range(1, 1000001):
    cnt[i] += cnt[i - 1]
while True:
    try:
        n = int(input())
        print(cnt[n])
    except EOFError:
        break

-era = [True] * 1000001 -for i in range(2, 1000001): -    if era[i - 2]: -        for j in range(i * 2, 1000001, i): -            era[j - 2] = False +IsPrimes = [True] * 1000002 +IsPrimes[0], IsPrimes[1] = False, False +for i in range(2, 1001): +    if IsPrimes[i]: +        for j in range(i * i, 1000001, i): +            IsPrimes[j] = False +cnt = [0] * 1000001 +for i in range(1000001): +    if IsPrimes[i]: +        cnt[i] += 1 +for i in range(1, 1000001): +    cnt[i] += cnt[i - 1] -        print(era[: n - 1].count(True)) +        print(cnt[n])