CodeEff/ECCO huggingface dataset:
# Original solution
# _*_ coding:utf-8 _*_
#  Atcoder_Beginners_Contest083-B
#  https://atcoder.jp/contests/abc080/tasks/abc080_b

def sumKeta(number):
	number2Str = str(number)
	numberLength=len(number2Str)
	thisNumberSum = 0
	ketaRange = list(range(0,numberLength,1))
	for i in ketaRange:
		thisNumberKeta = int(number2Str[i])
		thisNumberSum = thisNumberKeta + thisNumberSum

	return thisNumberSum


def  isThisHarshadNumber(objectNumber):
	digitSumNumber=sumKeta(objectNumber)
	modNumber = objectNumber % digitSumNumber
	if modNumber ==  0:
		answer = "Yes"
	else:
		answer = "No"
	return answer


if __name__ == '__main__':
	N = int(input().strip())
	solution=isThisHarshadNumber(N)
	print(solution)


# Optimized solution
# Problem: https://atcoder.jp/contests/abc080/tasks/abc080_b
# Python 1st Try

import sys
# from collections import defaultdict
# import heapq,copy
# from collections import deque
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def MI1(): return map(int1, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))


def LLI(rows_number): return [LI() for _ in range(rows_number)]


def solver(inputNum):
    result = "No"
    # algorithm
    strNum = str(inputNum)
    divisorNum = 0
    for j in range(0, len(strNum), +1):
        divisorNum = divisorNum + int(strNum[j])
    if inputNum % divisorNum == 0:
        result = "Yes"
    return result


if __name__ == "__main__":
    print("{}".format(solver(II())))
# Original solution
N=int(eval(input()))
N_list=list(str(N))

if len(N_list)==1:
    M=int(N_list[0])
    if N%M==0:
        print("Yes")
    else:
        print("No")
elif len(N_list)==2:
    I=int(N_list[0])+int(N_list[1])
    if N%I==0:
        print("Yes")
    else:
        print("No")
elif len(N_list)==3:
    U=int(N_list[0])+int(N_list[1])+int(N_list[2])
    if N%U==0:
        print("Yes")
    else:
        print("No")
elif len(N_list)==4:
    K=int(N_list[0])+int(N_list[1])+int(N_list[2])+int(N_list[3])
    if N%K==0:
        print("Yes")
    else:
        print("No")
elif len(N_list)==5:
    O=int(N_list[0])+int(N_list[1])+int(N_list[2])+int(N_list[3])+int(N_list[4])
    if N%O==0:
        print("Yes")
    else:
        print("No")
elif len(N_list)==6:
    G=int(N_list[0])+int(N_list[1])+int(N_list[2])+int(N_list[3])+int(N_list[4])+int(N_list[5])
    if N%G==0:
        print("Yes")
    else:
        print("No")
elif len(N_list)==7:
    W=int(N_list[0])+int(N_list[1])+int(N_list[2])+int(N_list[3])+int(N_list[4])+int(N_list[5])+int(N_list[6])
    if N%W==0:
        print("Yes")
    else:
        print("No")
elif len(N_list)==8:
    S=int(N_list[0])+int(N_list[1])+int(N_list[2])+int(N_list[3])+int(N_list[4])+int(N_list[5])+int(N_list[6])+int(N_list[7])
    if N%S==0:
        print("Yes")
    else:
        print("No")

# Optimized solution
N=int(eval(input()))
f_x=sum(map(int,str(N)))
if N%f_x==0:
    print("Yes")
else:
    print("No")
# Original solution
n = int(eval(input()))


def sum_digits(n):
    result = n % 10
    while n // 10 != 0:
        n //= 10
        result += (n % 10)

    return result


if n % sum_digits(n) == 0:
    print("Yes")
else:
    print("No")


# Optimized solution
def calculate_summary_of_digits(n):
    result = 0
    while n != 0:
        result += (n % 10)

        n //= 10

    return result


n = int(eval(input()))

sum_of_digits = calculate_summary_of_digits(n)
print(("Yes" if n % sum_of_digits == 0 else "No"))
# Original solution
N=int(eval(input()))
N_sum=list(str(N))
fN=0
for n in range(len(N_sum)):
  fN+=int(N_sum[n])
if N%fN==0:
  print('Yes')
else:
  print('No')


# Optimized solution
n = int(eval(input()))
x = sum([int(s) for s in str(n)])
print(('Yes' if n%x == 0 else 'No'))
# Original solution
n=input()
fx=0
for i in n:
  fx+=int(i)
print('Yes') if int(n)%fx==0 else print('No')


# Optimized solution
n=i=int(input())
sum=0
while i/10>0:
  sum+=int(i%10)
  i=int(i/10)
print('Yes') if n%sum==0 else print('No')
# Original solution
while 1:
    k=int(eval(input()))
    if k==0:break
    print((sum(map(int,input().split()))//(k-1)))

# Optimized solution
while 1:
    k=int(eval(input()))-1
    if k<0:break
    print((sum(map(int,input().split()))//k))
# Original solution
import sys

def solve():
  while(1):
    n = int(input())
    if n == 0:
      break
    score_a, score_b = 0, 0
    while(n > 0):
      a, b = list(map(int, input().split()))
      if a > b:
        score_a += a + b
      elif b > a:
        score_b += a + b
      else:
        score_a += a
        score_b += b
      n -= 1
    print(score_a, score_b)

if __name__ == '__main__':
  solve()

# Optimized solution

def solve():
  while(1):
    n = int(input())
    if n == 0:
      break
    score_a, score_b = 0, 0
    while(n > 0):
      a, b = list(map(int, input().split()))
      if a > b:
        score_a += a + b
      elif b > a:
        score_b += a + b
      else:
        score_a += a
        score_b += b
      n -= 1
    print(score_a, score_b)

if __name__ == '__main__':
  solve()
# Original solution
import sys


def main():
    n, s = sys.stdin.read().split()
    n = int(n)

    left, right = 0, 0
    for char in s:
        if char == '(':
            right += 1 
            # これ以前に出現している')'の数が'('の数より多い可能せがあるのでleftを削ることはできないため、ペアになる可能性としての')'を追加
        elif char == ')':
            if right: 
                # rightがあるならこれより前に必ずペア未確定の'('が存在するのでrightの可能性を一つ削ってこれを代わりにその'('とペアにする
                right -= 1
            else: 
                # rightがない場合はペア未確定の'('がこれ以前に出現していないということので'('を追加してこれとペアにするしかない
                left += 1
    
    ans = '(' * left + s + ')' * right
    print(ans)


if __name__ == "__main__":
    main()


# Optimized solution
import sys

n = int(sys.stdin.readline().rstrip())
s = sys.stdin.readline().rstrip()

def main():
    l = r = 0
    for char in s:
        if char == '(':
            r += 1
        elif char == ')':
            if r:
                r -= 1
            else:
                l += 1

    return '(' * l + s + ')' * r

if __name__ == '__main__':
    ans = main()
    print(ans)
# Original solution
eval(input())
s = input().strip()
ans = s
depth = 0
for c in s:
    if c == '(':
        depth += 1
    else:
        if depth:
            depth -= 1
        else:
            ans = '(' + ans
ans += ')' * depth
print(ans)


# Optimized solution
eval(input())
s = input().strip()
stock, depth = 0, 0
for c in s:
    if c == '(':
        depth += 1
    else:
        if depth:
            depth -= 1
        else:
            stock += 1
print(('(' * stock + s + ')' * depth))
# Original solution
N = int(eval(input()))
S = input().strip()
S1 = S
cur = 0
for i in range(len(S)):
    if S[i]=="(":
        cur += 1
    else:
        cur -= 1
    if cur<0:
        S1 = "("+S1
        cur += 1
S1 = S1+")"*cur
print(S1)

# Optimized solution
N = int(eval(input()))
S = input().strip()
while True:
    lv = 0
    lmin = len(S)
    for i in range(len(S)):
        if S[i]=="(":
            lv += 1
        else:
            lv -= 1
        lmin = min(lmin,lv)
    if lmin<0:
        S = "("*(-lmin)+S
    else:break
lv = 0
for i in range(len(S)):
    if S[i]=="(":
        lv += 1
    else:
        lv -= 1

if lv>0:
    S = S+")"*lv
print(S)
# Original solution
import sys
import collections


def solve():
    input = sys.stdin.readline
    mod = 10 ** 9 + 7
    n = int(input().rstrip('\n'))
    s = list(str(input().rstrip('\n')))
    s1 = collections.deque(s)
    s2 = collections.deque(s)
    while True:
        ln = len(s1)
        while True:
            s1 = collections.deque(list("".join(s1).replace("()", "")))
            if len(s1) == ln:
                break
            else:
                ln = len(s1)
        if len(s1) == 0:
            break
        elif s1[0] == "(":
            s1.append(")")
            s2.append(")")
        else:
            s1.appendleft("(")
            s2.appendleft("(")
    print(("".join(s2)))


if __name__ == '__main__':
    solve()


# Optimized solution
import sys
import collections


def solve():
    input = sys.stdin.readline
    mod = 10 ** 9 + 7
    n = int(input().rstrip('\n'))
    s = list(str(input().rstrip('\n')))
    s = collections.deque(s)
    ds = collections.deque(s)
    while s:
        while True:
            ll = len(s)
            s = collections.deque(list("".join(s).replace("()", "")))
            if ll == len(s):
                break
        if len(s) != 0:
            if s[0] == "(":
                s.append(")")
                ds.append(")")
            else:
                s.appendleft("(")
                ds.appendleft("(")
        else:
            print(("".join(ds)))


if __name__ == '__main__':
    solve()
# Original solution
# ?´???°?????°?????¨?????????????????°??????

import sys

prim_no = {}

def is_prime(no):
    if no == 2:
        return True
    
    if no % 2 == 0:
        return False

    if prim_no.get(no) is not None:
        return prim_no.get(no)
    
    for i in range(3, no // 2):
        if no % i == 0:
            prim_no[no] = False
            return False

    prim_no[no] = True
    return True

while True:
    num = sys.stdin.readline()
    if num is None or num.strip() == '':
        break

    num = int(num.strip())
    cnt = 0
    for i in range(2, num + 1):
        if is_prime(i):
            cnt += 1

    print(cnt)

# Optimized solution
# ?´???°?????°?????¨?????????????????°??????

import sys
import math

prim_no = {}                    # ????????°????´???°??§??????????????????????????????

def is_prime(no):
    if no == 2:
        return True
    
    if no % 2 == 0:
        return False

    if prim_no.get(no) is not None:
        return prim_no.get(no)

    max_check = int(math.sqrt(no))
    for i in range(3, max_check+1):
        if no % i == 0:
            prim_no[no] = False
            return False

    prim_no[no] = True
    return True

def main():
    while True:
        num = sys.stdin.readline()
        if num is None or num.strip() == '':
            break

        num = int(num.strip())
        cnt = 0
        for i in range(2, num + 1):
            if is_prime(i):
                cnt += 1

        print(cnt)

if __name__ == '__main__':
    main()
# Original solution
# ?´???°?????°?????¨?????????????????°??????

import sys
import math

prim_no = {}                    # ????????°????´???°??§??????????????????????????????

def is_prime(no):
    if no == 2:
        return True
    
    if no % 2 == 0:
        return False

    if prim_no.get(no) is not None:
        return prim_no.get(no)

    max_check = int(math.sqrt(no))
    for i in range(3, max_check+1):
        if no % i == 0:
            prim_no[no] = False
            return False

    prim_no[no] = True
    return True

def main():
    while True:
        num = sys.stdin.readline()
        if num is None or num.strip() == '':
            break

        num = int(num.strip())
        cnt = 0
        for i in range(2, num + 1):
            if is_prime(i):
                cnt += 1

        print(cnt)

if __name__ == '__main__':
    main()
    

# Optimized solution
# ?´???°?????°?????¨?????????????????°??????

import sys
import math

prim_no = {}                    # ????????°????´???°??§??????????????????????????????

def is_prime(no):
    if no == 2:
        return True
    
    if no % 2 == 0:
        return False

    if prim_no.get(no) is not None:
        return prim_no.get(no)

    max_check = int(math.sqrt(no))
    for i in range(3, max_check+1, 2):
        if no % i == 0:
            prim_no[no] = False
            return False

    prim_no[no] = True
    return True

def main():
    while True:
        num = sys.stdin.readline()
        if num is None or num.strip() == '':
            break

        num = int(num.strip())
        cnt = 0
        for i in range(2, num + 1):
            if is_prime(i):
                cnt += 1

        print(cnt)

if __name__ == '__main__':
    main()
# Original solution
try:
    while True:
        n = int(eval(input()))
        datasets = list(range(2, n+1))
        answers = set([])
        while datasets:
            i = datasets[0]
            datasets = [data for data in datasets if data%i != 0]
            answers.add(i)
        print((len(answers)))
except:
    pass

# Optimized solution
def prime_number(n):
    cache = {2} 
    a = 2 
    while a <= n:
        if n < 2:
            cache = {}
            break
        if not a in cache:
            if not [x for x in cache if a % x == 0]: 
                cache.add(a)
        a+=1
    print((len(cache)))

try:
    while True:
        n=int(eval(input()))
        prime_number(n)
except:
    pass
# Original solution
import sys
p=[1]*999999
p[0]=p[1]=0
p[4::2]=[0]*len(p[4::2])
for i in range(3,1000,2):p[i*i::i]=[0]*len(p[i*i::i])
for n in sys.stdin:print(p[0:int(n)+1].count(1))

# Optimized solution
max_n = 999999
prime_list = [1] * (max_n + 1)

# 0, 1は素数ではない
prime_list[0:2] = [0, 0]

# 
for i in range(2, int(max_n**0.5) + 1):
    if prime_list[i] == 1:
        prime_list[i**2::i] = [0] * len(prime_list[i**2::i])

while True:
    try:
        n = int(eval(input()))
        print((sum(prime_list[:n + 1])))

    except EOFError:
        break
# Original solution
# -*- coding: utf-8 -*-

import sys

for line in sys.stdin:
    input_number = int(line.strip())

    if input_number == 1:
        print(0)
        continue
    elif input_number == 2:
        print(1)
        continue

    prime_numbers = [2]
    candidate_number = 3
    while candidate_number <= input_number:
        flag = True
        for index, number in enumerate(prime_numbers):
            if candidate_number % number == 0:
                flag = False
                break
            elif number * prime_numbers[index - 1] > input_number and index >= 1:
                break
        if flag:
            prime_numbers.append(candidate_number)
        candidate_number += 2

    print(len(prime_numbers))

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

import sys
import math

for line in sys.stdin:
    input_number = int(line.strip())

    if input_number == 1:
        print(0)
        continue
    elif input_number == 2:
        print(1)
        continue

    prime_numbers = [2]
    candidate_number = 3
    while candidate_number <= input_number:
        flag = True
        max_number = int(math.sqrt(prime_numbers[-1]))
        for number in prime_numbers:
            if candidate_number % number == 0:
                flag = False
                break
            elif number > max_number:
                break
        if flag:
            prime_numbers.append(candidate_number)

        candidate_number += 2

    print(len(prime_numbers))
# Original solution
import sys,random

rand = random.randint

def prime(n):
	if n == 2:
		return True
	if n < 2 or n & 1 == 0:
		return False
	d = (n-1) >> 1
	while d & 1 == 0:
		d >>= 1
	
	for i in range(5):
		a = rand(1,n-1)
		t = d
		y = pow(a,t,n)
		while t != n-1 and y != 1 and y != n-1:
			y = pow(y,2,n)
			t <<= 1
		if y != n-1 and t & 1 == 0:
			return False
	return True

a = [prime(i) for i in range(1000000)]

for s in sys.stdin:
	i = int(s)
	print((a[:i+1].count(True)))

# Optimized solution
import sys,random

rand = random.randint

def prime(n):
	if n == 2:
		return True
	if n < 2 or n & 1 == 0:
		return False
	d = (n-1) >> 1
	while d & 1 == 0:
		d >>= 1
	
	for i in range(4):
		a = rand(1,n-1)
		t = d
		y = pow(a,t,n)
		while t != n-1 and y != 1 and y != n-1:
			y = pow(y,2,n)
			t <<= 1
		if y != n-1 and t & 1 == 0:
			return False
	return True

a = [prime(i) for i in range(1000000)]

for s in sys.stdin:
	i = int(s)
	print((a[:i+1].count(True)))
# Original solution
import sys,random

rand = random.randint

def prime(n):
	if n == 2:
		return True
	if n < 2 or n & 1 == 0:
		return False
	d = (n-1) >> 1
	while d & 1 == 0:
		d >>= 1
	
	for i in range(4):
		a = rand(1,n-1)
		t = d
		y = pow(a,t,n)
		while t != n-1 and y != 1 and y != n-1:
			y = pow(y,2,n)
			t <<= 1
		if y != n-1 and t & 1 == 0:
			return False
	return True

a = [prime(i) for i in range(1000000)]

for s in sys.stdin:
	i = int(s)
	print((a[:i+1].count(True)))

# Optimized solution
import sys,random

rand = random.randint

def prime(n):
	if n == 2:
		return True
	if n < 2 or n & 1 == 0:
		return False
	d = (n-1) >> 1
	while d & 1 == 0:
		d >>= 1
	
	for i in range(3):
		a = rand(1,n-1)
		t = d
		y = pow(a,t,n)
		while t != n-1 and y != 1 and y != n-1:
			y = pow(y,2,n)
			t <<= 1
		if y != n-1 and t & 1 == 0:
			return False
	return True

a = [prime(i) for i in range(1000000)]

for s in sys.stdin:
	i = int(s)
	print((a[:i+1].count(True)))
# Original solution
import sys,random

rand = random.randint

def prime(n):
	if n == 2:
		return True
	if n < 2 or n & 1 == 0:
		return False
	d = (n-1) >> 1
	while d & 1 == 0:
		d >>= 1
	
	for i in range(3):
		a = rand(1,n-1)
		t = d
		y = pow(a,t,n)
		while t != n-1 and y != 1 and y != n-1:
			y = pow(y,2,n)
			t <<= 1
		if y != n-1 and t & 1 == 0:
			return False
	return True

a = [prime(i) for i in range(1000000)]

for s in sys.stdin:
	i = int(s)
	print((a[:i+1].count(True)))

# Optimized solution
import sys

a = [True] * 1000000

for i in range(2,1000000):
	if(a[i-1]):
		for j in range(i**2-1, 1000000, i):
			a[j] = False

for s in sys.stdin:
	print((a[1:int(s)].count(True)))
# Original solution
import math

ans = []
while True:
	try:
		n = int(input())
		if n < 2:
			ans.append(0)
			continue
		prime_list = list(range(3, n + 1, 2))
		prime_list.insert(0, 2)
		head = prime_list[0]
		i = 0
		while head < math.sqrt(n):
			for j in range(len(prime_list) - 1, 0, -1):
				if (prime_list[j] % head == 0) & (prime_list[j] != head):
					del prime_list[j]
			i += 1
			head = prime_list[i]
		ans.append(len(prime_list))
	except EOFError:
		break
for num in ans:
	print(num)

# Optimized solution
import math

ans = []
while True:
	try:
		n = int(input())
		isPrime = [False, False]
		for i in range(n - 1):
			isPrime.append(True)
		i = 2
		while i < math.sqrt(n):
			j = i * 2
			while j < len(isPrime):
				isPrime[j] = False
				j += i
			i += 1
		ans.append(isPrime.count(True))
	except EOFError:
		break
for num in ans:
	print(num)
# Original solution
import math

ans = []
while True:
	try:
		n = int(input())
		isPrime = [False, False]
		for i in range(n - 1):
			isPrime.append(-1)
		i = 2
		while i < math.sqrt(n):
			j = i 
			while j < len(isPrime):
				isPrime[j] = False
				j += i
			isPrime[i] = True
			i = isPrime.index(-1)
		ans.append(isPrime.count(True) + isPrime.count(-1))
	except EOFError:
		break
for num in ans:
	print(num)

# Optimized solution
import math

ans = []
while True:
	try:
		n = int(input())
		isPrime = [-1] * (n + 1)
		isPrime[0], isPrime[1] = False, False
		i = 2
		while i * i < n:
			j = i 
			while j < len(isPrime):
				isPrime[j] = False
				j += i
			isPrime[i] = True
			i = isPrime.index(-1)
		ans.append(isPrime.count(True) + isPrime.count(-1))
	except EOFError:
		break
for num in ans:
	print(num)
# Original solution
import sys
m=10**6;a=[1]*m;a[0:2]=0,0
for i in range(2,1000):
 if a[i]>0:
  for j in range(i*2,m,i):a[j]=0
for i in range(m):a[i]+=a[i-1]
for e in sys.stdin:print((a[int(e)]))


# Optimized solution
import sys
m=10**6;a=[1]*m;a[0:2]=0,0
for i in range(2,999):
 if a[i]>0:
  for j in range(i*2,m,i):a[j]=0
for i in range(m):a[i]+=a[i-1]
for e in sys.stdin:print((a[int(e)]))
# Original solution
import sys
m=10**6;a=[0,0]+[1]*m
for i in range(2,999):
 if a[i]:
  for j in range(i*2,m,i):a[j]=0
for e in sys.stdin:print((sum(a[:int(e)+1])))


# Optimized solution
import sys
m=10**6;a=[0,0]+[1]*m
for i in range(999):
 if a[i]:
  for j in range(i*2,m,i):a[j]=0
for e in sys.stdin:print((sum(a[:int(e)+1])))
# Original solution
import sys
m=10**6;a=[0,0]+[1]*m
for i in range(999):
 if a[i]:
  for j in range(i*2,m,i):a[j]=0
for e in sys.stdin:print((sum(a[:int(e)+1])))


# Optimized solution
import sys
m=10**6;a=[0,0]+[1]*m
for i in range(999):
 if a[i]:a[i*2::i]=[0 for j in a[i*2::i]]
for e in sys.stdin:print((sum(a[:int(e)+1])))
# Original solution
import sys
a=[0,0]+[1]*10**6
for i in range(999):
 if a[i]:a[i*2::i]=[0 for j in[0]*len(a[i*2::i])]
for e in sys.stdin:print((sum(a[:int(e)+1])))


# Optimized solution
import sys
a=[0,0]+[1]*10**6
for i in range(999):
 if a[i]:a[i*2::i]=[0]*len(a[i*2::i])
for e in sys.stdin:print((sum(a[:int(e)+1])))
# Original solution
import sys
a=[0,0,1]+[1,0]*499999
for i in range(3,999,2):
 if a[i]:a[i*2::i]=[0]*len(a[i*2::i])
for e in sys.stdin:print((sum(a[:int(e)+1])))


# Optimized solution
import sys
a=[0,0,1]+[1,0]*499999
for i in range(3,999,2):
 if a[i]:a[i*i::i]=[0]*len(a[i*i::i])
for e in sys.stdin:print((sum(a[:int(e)+1])))
# Original solution
import sys
m=166666;a=[[1]*m for _ in[0]*2]
for i in range(m):
 if a[0][i]:
  k=6*i+5
  a[0][i+k::k]=[0]*len(a[0][i+k::k])
  a[1][-2-i+k::k]=[0]*len(a[1][-2-i+k::k])
 if a[1][i]:
  k=6*i+7
  a[0][-2-i+k::k]=[0]*len(a[0][-2-i+k::k])
  a[1][i+k::k]=[0]*len(a[1][i+k::k])
for e in map(int,sys.stdin):
 print(([e-1,sum(a[0][:(e+1)//6]+a[1][:(e-1)//6])+2][e>3]))


# Optimized solution
import sys
m=166666;s=[1]*m;t=[1]*m
for i in range(m):
 if s[i]:
  k=6*i+5
  s[i+k::k]=[0]*len(s[i+k::k])
  t[-2-i+k::k]=[0]*len(t[-2-i+k::k])
 if t[i]:
  k=6*i+7
  s[-2-i+k::k]=[0]*len(s[-2-i+k::k])
  t[i+k::k]=[0]*len(t[i+k::k])
for e in map(int,sys.stdin):
 print(([e-1,sum(s[:(e+1)//6])+sum(t[:(e-1)//6])+2][e>3]))
# Original solution
import sys
m=166666;s=[1]*m;t=[1]*m
for i in range(m):
 for j in range(2):
  if (s[i],t[i])[j]:
   k=6*i+[5,7][j];n=[i+k,k-i-2]
   s[n[j]::k]=[0]*len(s[n[j]::k])
   t[n[1-j]::k]=[0]*len(t[n[1-j]::k])
for e in map(int,sys.stdin):
 print(([e-1,sum(s[:(e+1)//6])+sum(t[:(e-1)//6])+2][e>3]))


# Optimized solution
import sys
a=[1]*500000
for i in range(3,999,2):
 if a[i//2]:a[(i*i)//2::i]=[0]*len(a[(i*i)//2::i])
for e in map(int,sys.stdin):print(([e-1,sum(a[:(e+1)//2])][e>3]))
# Original solution
import sys
a=[1]*500000
for i in range(3,999,2):
 if a[i//2]:a[(i*i)//2::i]=[0]*len(a[(i*i)//2::i])
[print([e-1,sum(a[:(e+1)//2])][e>3])for e in map(int,sys.stdin)]


# Optimized solution
import sys
m=500000;a=[1]*m
for i in range(3,999,2):
 if a[i//2]:a[i*i//2::i]=[0]*((m-1-i*i//2)//i+1)
for e in map(int,sys.stdin):print(([e-1,sum(a[:(e+1)//2])][e>3]))
# Original solution
def sieve(n):
	nums = [i+1 for i in range(2, n, 2)]
	ans = [2]
	while len(nums) != 0:
		for i in range(nums[0]*2, nums[-1]+1, nums[0]):
			if i in nums: nums.remove(i)
		ans.append(nums.pop(0))
	return len(ans)

while True:
	try:
		print(sieve(eval(input())))
	except:
		break

# Optimized solution
#!/usr/bin/python

def judge_prime(n):
    if n == 2: return True
    if n < 2: return False
    return pow(2, n-1, n) == 1

while True:
	try:
		ans = 0
		for i in range(eval(input())):
			if judge_prime(i+1):
				ans += 1
		print(ans)
	except:
		break
# Original solution
from collections import deque
import bisect
from math import sqrt
import sys
primes = deque([2, 3, 5, 7, 11, 13, 17, 19])
append = primes.append
for i in range(21, 1000000, 2):
    for j in range(3, int(sqrt(i))+1, 2):
        if i%j == 0:
            break
    else:
        append(i)

for l in sys.stdin:
    print((bisect.bisect(primes, int(l))))

# Optimized solution
import bisect
import sys
n = 1000000
primes = {i for i in range(3, n, 2)}
for i in range(3, 1000, 2):
    s = {j for j in range(i*2, n, i)}
    primes -= s

primes = [2] + sorted(primes)
for l in sys.stdin:
    print((bisect.bisect(primes, int(l))))
# Original solution
import sys
import math

def isPrime(n):
    if n < 2:
        return False
    elif n == 2:
        return True

    if n % 2 == 0:
        return False

    for i in range(3,math.ceil(math.sqrt(n))+1):
         if n % i == 0:
            return False
    return True

for line in sys.stdin:
    n = int(line)
    count = 0
    for i in range(2,n+1):
        if isPrime(i):
            count += 1
    print(count)

# Optimized solution
import sys
for i in sys.stdin:
    n = int(i)
    arr = [i for i in range(0,n+1)]
    for i in range(2, len(arr)):
        if arr[i] != 0:
            j = 2
            while i*j <= n:
                if arr[i*j] != 0:
                    arr[i*j] = 0
                j += 1
    primNum = 0
    for i in arr:   
        if i > 1:
            primNum += 1
    print(primNum)