CodeEff/ECCO huggingface dataset:
# Original solution
# -*- coding: utf-8 -*-

import sys

def isprime(n):
    for i in range(2, int(n**0.5)+1):
        if n % i == 0: return False
    return True

limit = 1000000
ansList = [0]*limit # 1 is not prime
cnt = 0
for i in range(2, limit):
    if isprime(i): cnt += 1
    ansList[i-1] = cnt

#for line in ["999999"]:
for line in sys.stdin.readlines():
    List = list(map(int, line.strip().split()))

    n = List[0]
    print(ansList[n-1])

# Optimized solution
# -*- coding: utf-8 -*-

import sys

limit = 1000000

prime01List = [1]*limit
prime01List[0] = 0 # 1 is not prime
for i in range(2, int(limit**0.5)+1):
    n = 2*i
    while(n <= limit):
        prime01List[n-1] = 0
        n += i


ansList = [0]*limit
cnt = 0
for i in range(limit):
    cnt += prime01List[i]
    ansList[i] = cnt


#for line in ["999999"]:
for line in sys.stdin.readlines():
    List = list(map(int, line.strip().split()))

    n = List[0]
    print(ansList[n-1])
# Original solution
p = [1]
n = [0,0]
c = 0
for i in range(1,1000000):
    p.append(0)
for i in range(2,1000000):
    if p[i]==1 :
        n.append(c)
        continue
    c += 1
    n.append(c)
    for j in range(i*i,1000000,i):
        if p[j]==0 : p[j]=1
while True:
    try:
        nn = int(input())
        print(n[nn])
    except(EOFError) : break

# Optimized solution
M = 10**6

p = [0]*(M+60)
sM = M**0.5
for x in range(1, int(sM/2)+1):
    v = 4*x*x + 1; y = 8
    while v <= M:
        if v % 12 != 9: # v % 12 in [1, 5]
            p[v] ^= 1
        v += y; y += 8
for x in range(1, int(sM/3**0.5)+1, 2):
    v = 3*x*x + 4; y = 12
    while v <= M:
        if v % 12 == 7:
            p[v] ^= 1
        v += y; y += 8
for x in range(2, int(sM/2**0.5)+1):
    v = 2*x*(x+1)-1; y = 4*x-8
    while 0 <= y and v <= M:
        if v % 12 == 11:
            p[v] ^= 1
        v += y; y -= 8

for n in range(5, int(sM)+1):
    if p[n]:
        for z in range(n*n, M, n*n):
            p[z] = 0
p[2] = p[3] = 1

c = [0]*M
cnt = 0
for i in range(M):
    if p[i]:
        cnt += 1
    c[i] = cnt

while 1:
    try:
        n = int(eval(input()))
    except:
        break
    print((c[n]))
# Original solution
# coding: utf-8
# Here your code !
import math
 
def is_prime_num(in_num):
    cnt = 0
    if in_num == 2:
        return True
    elif in_num <= 1:
        return False
    elif in_num % 2 == 0:
        return False
    else:
        if pow(2, in_num-1, in_num) == 1:
            max_num = int(math.sqrt(in_num)+1)
            for j in range(3, max_num, 2):
                if in_num % j == 0:
                    cnt = cnt + 1
                    break
                         
            if cnt == 0:
                #??´????°
                return True
            else:
               return False
        else:
            return False

while True:
    try:
        n = int(eval(input()))
        prime_cnt = 0
        if n >= 2:
            #?????????2???????????????
            prime_cnt = prime_cnt + 1

        for i in range(3, n+1, 2):
            if is_prime_num(i):
                prime_cnt = prime_cnt + 1
                 
 
        print((str(prime_cnt)))
    except:
        break
    

# Optimized solution
# coding: utf-8
# Here your code !
import math
  
def is_prime_num(in_num):
    cnt = 0
    if in_num == 2:
        return True
    elif in_num <= 1:
        return False
    elif in_num % 2 == 0:
        return False
    else:
        if pow(2, in_num-1, in_num) == 1:
            return True
        else:
            return False
 
while True:
    try:
        n = int(eval(input()))
        prime_cnt = 0
        if n >= 2:
            #?????????2???????????????
            prime_cnt = prime_cnt + 1
 
        for i in range(3, n+1, 2):
            if is_prime_num(i):
                prime_cnt = prime_cnt + 1
                  
  
        print((str(prime_cnt)))
    except:
        break
# Original solution
while True:
    try:
        Num = 1
        n = int(eval(input()))
        for i in range(2,n+1):
            for j in range(2,i):
                if i % j == 0:
                    break
                if j == i-1:
                    Num +=1
        print(Num)           
    except EOFError:
        break

# Optimized solution
DP = [0,1,2]

while True:
    try:
        n = int(eval(input()))
        if len(DP) < n:
            for i in range(len(DP) + 1,n+1):
                YN = 0
                for j in range(2,i - 1):
                    if i % j == 0:
                        DP.append(DP[len(DP) - 1])
                        YN = 1
                        break
                    elif j ** 2 > i:
                        DP.append(DP[len(DP) - 1] + 1)
                        break

        print((DP[n - 1]))
    except EOFError:
        break
# Original solution
lis=[1 for i in range(int(1e6+1))]

lis[0]=lis[1]=0

for i in range(int(1e6)+1):
    if lis[i]:
        for j in range(i*2,int(1e6+1),i):
            lis[j]=0

while True:
    try:
        n=int(eval(input()))
        cnt=0
        for i in range(n+1):
            if lis[i]:
                cnt+=1

        print(cnt)
        
        
    except:
        break

# Optimized solution
lis=[True for i in range(int(1e6+1))]

lis[0]=lis[1]=False
end=int(1e6**0.5)
for i in range(end+1):
    if lis[i]:
        for j in range(i*2,int(1e6+1),i):
            lis[j]=False

while True:
    try:
        n=int(eval(input()))
        cnt=0
        for i in range(n+1):
            if lis[i]:cnt+=1
        print(cnt)
        
        
    except EOFError:
        break
# Original solution
lis=[True for i in range(int(1e6+1))]

lis[0]=lis[1]=False
end=int(1e6**0.5)
for i in range(end+1):
    if lis[i]:
        for j in range(i*2,int(1e6+1),i):
            lis[j]=False

while True:
    try:
        n=int(eval(input()))
        cnt=0
        for i in range(n+1):
            if lis[i]:cnt+=1
        print(cnt)
        
        
    except EOFError:
        break

# Optimized solution
def sieve(n):
    p=[True for i in range(n+1)]
    p[0]=p[1]=False
    end=int(n**0.5)

    for i in range(2,end+1):
        if p[i]:
            for j in range(i*i,n+1,i):
                p[j]=False

    return p

def solve(n):
    if n<2:return 0
    cnt=1
    for i in range(3,n+1,2):
        if p[i]:cnt+=1

    return cnt

p=sieve(int(1e6))

while True:
    try:
        n=int(eval(input()))
        print((solve(n)))
    except:
        break
# Original solution
def isprime(n):
    p = 3
    while p * p <= n:
        if n % p == 0: return False
        p += 2
    return True

while True:
    try:
        n = int(eval(input()))
    except:
        break

    count = int(n >= 2)
    for p in range(3,n + 1,2):
        if isprime(p): count += 1
    print(count)

# Optimized solution
while True:
    try:
        n = int(eval(input()))
    except:
        break

    a = [0 for i in range(n + 1)]

    # sieve
    i = 3
    while i * i <= n:
        for j in range(3 * i, n + 1, 2 * i): a[j] = 1
        i += 2

    count = int(n >= 2)
    count += sum(a[i] == 0 for i in range(3, n + 1, 2))
    print(count)
# Original solution
try:
	while True:
		n = eval(input())
		ans = [1] * (n + 1);
		ans[0] = ans[1] = 0;
		for i in range(2, n + 1):
			if ans[i] != 0:
				for j in range(2 * i, n + 1, i):
					ans[j] = 0
		print(sum(ans))
except EOFError:
	pass

# Optimized solution
try:
	while True:
		j = 0
		n = eval(input())
		ans = [1] * (n + 1);
		ans[0] = ans[1] = 0;
		for i in range(2, n + 1):
			if i * 2 > n:
				break
			if ans[i] != 0:
				for j in range(2 * i, n + 1, i):
					ans[j] = 0
		print(sum(ans))
except EOFError:
	pass
# Original solution
try:
	while True:
		j = 0
		n = eval(input())
		ans = [1] * (n + 1);
		ans[0] = ans[1] = 0;
		for i in range(2, n + 1):
			if i * 2 > n:
				break
			if ans[i] != 0:
				for j in range(2 * i, n + 1, i):
					ans[j] = 0
		print(sum(ans))
except EOFError:
	pass

# Optimized solution
try:
	while True:
		j = 0
		n = eval(input())
		ans = [1] * (n + 1);
		ans[0] = ans[1] = 0;
		for i in range(3, n + 1, 2):
			if i * 2 > n:
				break
			if ans[i] != 0:
				for j in range(2 * i, n + 1, i):
					ans[j] = 0
		for k in range(2 * 2, n + 1, 2):
			ans[k] = 0
		print(sum(ans))
except EOFError:
	pass
# Original solution
try:
	while True:
		j = 0
		n = eval(input())
		ans = [1] * (n + 1);
		ans[0] = ans[1] = 0;
		for i in range(3, n + 1, 2):
			if i * 2 > n:
				break
			if ans[i] != 0:
				for j in range(2 * i, n + 1, i):
					ans[j] = 0
		for k in range(2 * 2, n + 1, 2):
			ans[k] = 0
		print(sum(ans))
except EOFError:
	pass

# Optimized solution
def prime_count(n):
	j = 0
	ans = [1] * (n + 1)
	ans[0] = ans[1] = 0
	for i in range(3, n + 1, 2):
		if i * 2 > n:
			break
		if ans[i] != 0:
			for j in range(2 * i, n + 1, i):
				ans[j] = 0
	for k in range(2 * 2, n + 1, 2):
		ans[k] = 0
	print(sum(ans))

try:
	while True:
		n = eval(input())
		prime_count(n)
except EOFError:
	pass
# Original solution
# Prime Number

import sys


count = 0
primes = [2, 3]

for n in range(5, 1000001, 2):
	isprime = True
	for i in range(1, len(primes)):
		count += 1
		if primes[i] * primes[i] > n:
			break
		count += 1
		if n % primes[i] == 0:
			isprime = False
			break
	if isprime:
		primes.append(n)

datas = []

for line in sys.stdin:
	datas.append(int(line))

for data in datas:
	count = 0
	for prime in primes:
		if prime <= data:
			count += 1
		else:
			break
	print(count)

# Optimized solution
# Prime Number

import sys


MAX_NUM = 1000000
ROOT_MAX_NUM = 1000

primes = [1] * MAX_NUM

primes[0] = primes[1] = 0

for i in range(2, ROOT_MAX_NUM):
	if not primes[i]:
		continue
	for j in range(i+i, MAX_NUM, i):
		primes[j] = 0

datas = []

for line in sys.stdin:
	datas.append(int(line))

for data in datas:
	count = 0
	for i in range(data+1):
		if primes[i]:
			count += 1
	print(count)
# Original solution
import sys
import math

N = 1000000
primes = [1] * N
primes[0] = 0
primes[1] = 0
primes[4::2] = [0] * len(primes[4::2])

for i in range(3,int(math.sqrt(N)),2):
    if primes[i]:
        primes[i*i::i*2] = [0] * len(primes[i*i::i*2])

for i in sys.stdin:
        n = int(i)
        print((sum(primes[0:n+1])))

# Optimized solution
import sys
import math

N = 1000000
primes = [1] * (N//2)
primes[0] = 0

for i in range(3,int(math.sqrt(N)),2):
    if primes[i//2]:
        primes[(i*i)//2::i] = [0] * len(primes[(i*i)//2::i])

for i in sys.stdin:
    n = int(i)
    if n == 1:
        print((0))
    elif n == 2:
        print((1))
    else:
        print((sum(primes[0:(n+1)//2])+1))
# Original solution
import sys
import math

N = 1000000
primes = [1] * (N//2+1)
primes[0] = 1

for i in range(3,int(math.sqrt(N))+1,2):
    if primes[i//2]:
        primes[(i*i)//2::i] = [0] * len(primes[(i*i)//2::i])
    primes[i//2] += primes[i//2-1]

for i in range(int(math.sqrt(N))+1,N+1,2):
    primes[i//2] += primes[i//2-1]


for i in sys.stdin:
    n = int(i)
    if n == 1:
        print((0))
    elif n == 2:
        print((1))
    else:
        print((primes[(n-1)//2]))

# Optimized solution
import sys
  
N = 1000000
primes = [1] * (N//2)
primes[0] = 0
  
for i in range(3,int(N**0.5),2):
    if primes[i//2]:
        primes[(i*i)//2::i] = [0] * len(primes[(i*i)//2::i])
  
for i in sys.stdin:
    n = int(i)
    if n < 3:
        print((n-1))
    else:
        print((sum(primes[:(n+1)//2])+1))
# Original solution
import sys
for line in sys.stdin:
    n=int(line)
    ans=0
    plist = [1 for i in range(n+1)]
    plist[0]=0
    plist[1]=0
    for x in range(len(plist)):
        if plist[x] == 1:
            ans+=1
            i=2
            while True:
                pos0 = x*i
                if pos0 < len(plist):
                    plist[pos0] = 0
                else:
                    break
                i+=1
    print(ans)

# Optimized solution
import sys
for line in sys.stdin:
    n=int(line)
    plist = [1 for i in range(n+1)]
    plist[0]=0
    plist[1]=0
    for x in range(int(n**0.5)+1):
        if plist[x] == 1:
            i=2
            while True:
                pos0 = x*i
                if pos0 < len(plist):
                    plist[pos0] = 0
                else:
                    break
                i+=1
    print(plist.count(1))
# Original solution
from math import sqrt
cash = {}
def isprime(n):
    if n in cash:
        return cash[n]
    if n == 1:
        return 0
    if n == 2:
        return 1
    if n % 2 == 0:
        return 0
    for i in range(2,int(sqrt(n)+1)):
        if n % i == 0:
            return 0
    cash[n] = 1
    return 1

from sys import stdin
h = {}
for i in stdin:
    i = int(i)
    c = sum(isprime(n) for n in range(2,i+1))
    print(c)

# Optimized solution
from math import sqrt
cash = {}
def isprime(n):
    if n in cash:
        return cash[n]
    if n == 1:
        cash[n] = 0
        return 0
    if n == 2:
        cash[n] = 1
        return 1
    if n % 2 == 0:
        cash[n] = 0
        return 0
    for i in range(2,int(sqrt(n)+1)):
        if n % i == 0:
            cash[n] = 0
            return 0
    cash[n] = 1
    return 1

from sys import stdin
cash2 = {}
for i in stdin:
    i = int(i)

    c = sum(isprime(n) for n in range(2,i+1))
    print(c)
# Original solution
from math import sqrt
cash = {}
def isprime(n):
    if n in cash:
        return cash[n]
    if n == 1:
        cash[n] = 0
        return 0
    if n == 2:
        cash[n] = 1
        return 1
    if n % 2 == 0:
        cash[n] = 0
        return 0
    for i in range(2,int(sqrt(n)+1)):
        if n % i == 0:
            cash[n] = 0
            return 0
    cash[n] = 1
    return 1

from sys import stdin
cash2 = {}
for i in stdin:
    i = int(i)

    c = sum(isprime(n) for n in range(2,i+1))
    print(c)

# Optimized solution
from math import sqrt
cash = {}
def isprime(n):
    if n in cash:
        return cash[n]
    if n == 1:
        cash[n] = 0
        return 0
    if n == 2:
        cash[n] = 1
        return 1
    if n % 2 == 0:
        cash[n] = 0
        return 0
    for i in range(3,int(sqrt(n)+1))[0::2]:
        if n % i == 0:
            cash[n] = 0
            return 0
    cash[n] = 1
    return 1

from sys import stdin
cash2 = {}
for i in stdin:
    i = int(i)
    c = sum(isprime(n) for n in range(2,i+1))
    print(c)
# Original solution
from math import sqrt
cash = {}
def isprime(n):
    if n in cash:
        return cash[n]
    if n == 1:
        cash[n] = 0
        return 0
    if n == 2:
        cash[n] = 1
        return 1
    if n % 2 == 0:
        cash[n] = 0
        return 0
    for i in range(3,int(sqrt(n)+1))[0::2]:
        if n % i == 0:
            cash[n] = 0
            return 0
    cash[n] = 1
    return 1

from sys import stdin
cash2 = {}
for i in stdin:
    i = int(i)
    c = sum(isprime(n) for n in range(2,i+1))
    print(c)

# Optimized solution
from math import sqrt
cash = {}
def isprime(n):
    if n in cash:
        return cash[n]
    if n == 1:
        cash[n] = 0
        return 0
    if n == 2:
        cash[n] = 1
        return 1
    if n % 2 == 0:
        cash[n] = 0
        return 0
    for i in range(3,int(sqrt(n)+1))[0::2]:
        if n % i == 0:
            cash[n] = 0
            return 0
    cash[n] = 1
    return 1

from sys import stdin
#cash2 = {}
for i in stdin:
    i = int(i)
    c = sum(isprime(n) for n in range(2,i+1)[1::2]) + 1
    print(c)
# Original solution
from math import sqrt
from sys import stdin
def isprime(n):
    if n == 1:
        return False
    if n == 2:
        return True
    if n % 2 == 0:
        return False
    for i in range(3, int(sqrt(n))+1):
        if n % i == 0:
            return False
    return True

for n in stdin:
    n = int(n)
    ct = 0
    for i in range(1,n + 1):
        if isprime(i):
            #print (i)
            ct += 1
    print (ct)

# Optimized solution
from math import sqrt,floor
from sys import stdin

def cntPrime(n):
    mx = sqrt(n) + 1
    l = [0] + [1] * (n - 1)
    c = 2
    while c < mx:

        for k in range(2, floor(n/c) + 1):
            l[c * k -1] = 0
        c = l[:c].index(1) + c
    return sum(l)
for n in stdin:
    n = int(n)
    print((cntPrime(n)))
# Original solution
from math import sqrt,floor
from sys import stdin

def cntPrime(n):
    mx = sqrt(n) + 1
    if n % 2 == 0:
      l = [0, 1] + [1, 0] * (int(n/2) - 1)
    else:
      l = [0, 1] + [1, 0] * (int(n/2) - 1) + [1]
    c = 3
    while c < mx:
        for k in range(c, floor(n/c) + 1, 1):
            l[c * k -1] = 0
        c = l[:c].index(1) + c
    return sum(l)
for n in stdin:
    n = int(n)
    print((cntPrime(n)))

# Optimized solution
from math import sqrt,floor
from sys import stdin

def cntPrime(n):
    mx = sqrt(n) + 1
    if n % 2 == 0:
      l = [0, 1] + [1, 0] * (int(n/2) - 1)
    else:
      l = [0, 1] + [1, 0] * (int(n/2) - 1) + [1]
    c = 3
    while c < mx:
        for k in range(c, floor(n/c) + 1, 1):
            l[c * k -1] = 0
        c = l[:c].index(1) + c
        while c % 2 == 0: 
            c = l[:c].index(1) + c
    return sum(l)
for n in stdin:
    n = int(n)
    print((cntPrime(n)))
# Original solution
import sys


def prime_list(n):
    limit = int(n ** 0.5) + 1
    lis = list(range(1, n + 1, 2))
    lis[0] = 2
    while True:
        if len(lis) == 0:
            break
        p = lis.pop(0)
        yield p
        if p <= limit:
            lis = [x for x in lis if x % p != 0]


def primes_number(n):
    primes = []
    for p in prime_list(n):
       primes.append(p)
    return len(primes)


#input_file = open(sys.argv[1], "r")

#for line in input_file:
for line in sys.stdin:
    n = int(line)
    print(primes_number(n))

# Optimized solution

import sys


def prime_list(n):
    limit = int(n ** 0.5) + 1
    lis = list(range(1, n + 1, 2))
    lis[0] = 2
    while True:
        if len(lis) == 0:
            break
        p = lis.pop(0)
        yield p
        if p <= limit:
            lis = [x for x in lis if x % p != 0]


def primes_number(n):
    primes = []
    for p in prime_list(n):
       primes.append(p)
    return primes


ns = list(map(int, sys.stdin.readlines()))
max_n = max(ns)

primes = primes_number(max_n)


for n in ns:
    p = len([x for x in primes if x <= n])
    print(p)
# Original solution
while True:
    try:
        n = int(eval(input()))
        count = 0
        if n == 1:
            print("0")
        else:
            a = [2*i for i in range(2, 1000000)]
            b = [3*i for i in range(2, 1000000)]
            c = [5*i for i in range(2, 1000000)]
            d = [7*i for i in range(2, 1000000)]
            for i in range(2, n+1):
                if i not in a and i not in b and i not in c and i not in d:
                    count += 1
            print(count)
    except:
        break

# Optimized solution
primes = [0, 0] + [1]*999999
for i in range(2, 1001):
    if primes[i]:
        for j in range(i*i, 1000001, i):
            primes[j] = 0

while True:
    try:
        n = int(eval(input())) + 1
        print((sum([1 for i in range(n) if primes[i]])))
    except:
        break
# Original solution
primes = [0, 0] + [1] * 999999
for i in range(2, 1000):
    if primes[i]:
        for j in range(i*i, 1000000, i):
            primes[j] = 0

answer = [0] * 1000000
for i in range(2, 1000000):
    answer[i] += primes[i] + answer[i-1]

while True:
    try:
        n = int(eval(input()))
    except:
        break
    print((answer[n]))



# Optimized solution
import bisect

primes = [0, 0] + [1] * 999999
for i in range(2, 1000):
    if primes[i]:
        for j in range(i*i, 1000000, i):
            primes[j] = 0

primes = [i for i, v in enumerate(primes) if v]
while True:
    try:
        n = int(eval(input()))
    except:
        break
    print((bisect.bisect(primes, n)))
# Original solution
import sys

MAX = 999999
L = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997]

def is_prime(n):
  if n == 2:return True
  if n % 2 == 0:return False
  for i in range(3,int(n**0.5)+1,2):
    if n % i == 0:return False
  return True

def is_prime_2(n):
  a = int(n ** 0.5)
  for i in L:
    if i > a:return True
    if n % i == 0:return False
  return True

def prime_count(n):
  result = 0
  if n >= 2:result+=1
  for i in range(3,n+1,2):
    if is_prime_2(i):result+=1
  return result

def prime_list(n):
  result = []
  if n >= 2:result.append(2)
  for i in range(3,n+1,2):
    if is_prime(i):result.append(i)
  return result

L2 = prime_list(MAX)

def prime_count_2(n):
  for i,v in enumerate(n):
    if n > v:return i
  return len(L2)

for n in sys.stdin:
  print((prime_count(int(n))))

# Optimized solution
import sys

MAX = 999999
L = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997]

def is_prime(n):
  if n == 2:return True
  if n % 2 == 0:return False
  for i in range(3,int(n**0.5)+1,2):
    if n % i == 0:return False
  return True

def is_prime_2(n):
  a = int(n ** 0.5)
  for i in L:
    if i > a:return True
    if n % i == 0:return False
  return True

def prime_count(n):
  result = 0
  if n >= 2:result+=1
  for i in range(3,n+1,2):
    if is_prime_2(i):result+=1
  return result

def prime_list(n):
  result = []
  if n >= 2:result.append(2)
  for i in range(3,n+1,2):
    if is_prime(i):result.append(i)
  return result

L2 = prime_list(MAX)

def prime_count_2(n):
  for i,v in enumerate(L2):
    if v > n:return i
  return len(L2)

for n in sys.stdin:
  print((prime_count_2(int(n))))