Harryxun/stf_run huggingface dataset:
import sys
lines = sys.stdin.readlines()
line1 = lines.pop(0).split(' ')
#print(line1)
N = int(line1[0])
M = int(line1[1])

#print(N)
#print(M)

str = [0] * N
ans = []
flg = 0
for i in range(M):
  line = lines.pop(0).split(' ')
#  print(line)
  s = int(line[0])
  c = int(line[1])
#  print(s)
#  print(c)
  str[s-1] = c
#  print('str = ')
#  print(str)
  one = int(str[0])
  if N == 3:
    ret = one*100 + int(str[1])*10 + int(str[2])
    if int(str[1])>0 or int(str[2])>0:
      flg = 1
  elif N == 2:
    ret = one*10 + int(str[1])
    if int(str[1]) > 0:
      flg = 1
  else:
    if one > 0:
      ret = one
  ans.append(ret)

#print(ans)
div = 1
if N == 3:
  div = 100
elif N == 2:
  div = 10

for obj in ans[:]:
  if (obj / (10**(N-1))) < 1:
    ans.remove(obj)
  elif flg == 1:
#   print('リムーブ候補')
#   print(obj)
#   print(div)
    a = obj % div
    print(a)
    if a == 0:
#      print('リムーブ')
      ans.remove(obj)

if not ans:
  print('-1')
else:
#  print(ans)
  print(min(ans))


### FIXED CODE ###

import math
print(math.ceil(int(input()) / 2))
def read():
    N = int(input().strip())
    A = list(map(int, input().strip().split()))
    return N, A


def next_state(c, a, n_patterns):
    # c := c[0] >= c[1] >= c[2]
    idx = c.index(a)
    n_equals = 1
    n_equals += 1 if c[idx%3] == c[(idx + 1) % 3] else 0
    n_equals += 1 if c[idx%3] == c[(idx + 2) % 3] else 0
    c[idx%3] += 1
    n_patterns *= n_equals
    n_patterns %= 1000000007
    return c, n_patterns

def solve(N, A):
    c = [0, 0, 0]
    n = 1
    for a in A:
        c, n = next_state(c, a, n)
    return n
    
if __name__ == '__main__':
    inputs = read()
    output = solve(*inputs)
    print("%d" % output)


### FIXED CODE ###

def read():
    N = int(input().strip())
    A = list(map(int, input().strip().split()))
    return N, A


def next_state(c, a, n_patterns):
    # c := c[0] >= c[1] >= c[2]
    idx = -1
    for i in range(3):
        if c[i] == a:
            idx = i
            break
    if idx == -1:
        return -1, -1
    n_equals = 1
    n_equals += 1 if c[idx%3] == c[(idx + 1) % 3] else 0
    n_equals += 1 if c[idx%3] == c[(idx + 2) % 3] else 0
    c[idx%3] += 1
    n_patterns *= n_equals
    n_patterns %= 1000000007
    return c, n_patterns

def solve(N, A):
    c = [0, 0, 0]
    n = 1
    for a in A:
        c, n = next_state(c, a, n)
        if c == -1 and n == -1:
            return 0
    return n
    
if __name__ == '__main__':
    inputs = read()
    output = solve(*inputs)
    print("%d" % output)
def main():
    N,K = map(int,input().split())
    As = list(map(int,input().split()))
    route = [0]
    pre = 0
    i = 0
    r_append = route.append
    for _ in range(N):
        i = As[i]-1
        if i in route:
            pre = route.index(i)
            route = route[pre:]
            break
        r_append(i)
        len_route += 1
    # print(route)
    mod = len(route)
    print(route[(K-pre)%mod]+1)

if __name__ == "__main__":
    main()

### FIXED CODE ###

N,K = map(int,input().split())
As = list(map(int,input().split()))
towns = [0]*N
route = [0]
pre = 0
i = 0
towns[0] = 1
for _ in range(K):
    i = As[i]-1
    if towns[i]>0:
        pre = route.index(i)
        route = route[pre:]
        break
    route.append(i)
    towns[i] = 1
mod = len(route)
print(route[(K-pre)%mod]+1)
N = int(input())
ts=[]
for i in range(N):
  x, l = map(int,input().split())
  if x + l <= 10**9:
    t = x + l
  else:
    t = s
  if x-l >= 0:
    s = x-l
  else:
    s = 0
  ts.append([t,s])
ts.sort()

count = 0
lastT = 0
for i in ts:
  if i[1]>=lastT:
    count+=1
    lastT=i[0]
print(count)

### FIXED CODE ###

n = int(input())
robotList=[]
for i in range(n):
  x,l = map(int,input().split())
  s = max(x-l,0)
  t = min(10**9,x+l)  
  robotList.append([t,s])
  
robotList.sort()

count = 0
tmp = 0
for robot in robotList:
  if robot[1] >= tmp:
    count += 1
    tmp = robot[0]

print(count)
from collections import defaultdict
import sys
input = sys.stdin.readline

N, M = list(map(int, input().split()))
node2set_id = defaultdict(int)
set_id2nodes = defaultdict(set)

# idxなどを振る
id_left = [i + 1 for i in range(M)]

for i in range(M):
    x, y, z = list(map(int, input().split()))

    # ともにIDが振られていないとき
    if node2set_id[x] + node2set_id[y] == 0:
        id = id_left.pop()
        # x,yが所属するグループIDを振る
        node2set_id[x] = id
        node2set_id[y] = id

        # グループIDに対するセットを追加
        set_id2nodes[id] |= {x, y}

    # どちらか一方にのみIDが振られているとき(片方が0になる)
    elif node2set_id[x] * node2set_id[y] == 0:
        id = node2set_id[x] + node2set_id[y]
        node2set_id[x] = id
        node2set_id[y] = id
        set_id2nodes[id] |= {x, y}

    # 両方振られているとき
    else:
        # 同じIDならそもそも考える必要がない
        if node2set_id[x] - node2set_id[y] == 0:
            continue

        # 異なるグループのときにはマージする
        id = node2set_id[x]
        prev_y = y

        # yが所属するグループIDをすべてxのものに置き換える
        for y_idx in set_id2nodes[node2set_id[y]]:
            node2set_id[y_idx] = id
            set_id2nodes[id] |= {y_idx}
        del set_id2nodes[prev_y]

num = sum([len(m)-1 for m in set_id2nodes.values()])

print(N-num)


### FIXED CODE ###

from collections import defaultdict
import sys
input = sys.stdin.readline

N, M = list(map(int, input().split()))
node2set_id = defaultdict(int)
set_id2nodes = defaultdict(set)

# idxなどを振る
id_left = [i + 1 for i in range(M)]

for i in range(M):
    x, y, z = list(map(int, input().split()))

    # ともにIDが振られていないとき
    if node2set_id[x] + node2set_id[y] == 0:
        id = id_left.pop()
        # x,yが所属するグループIDを振る
        node2set_id[x] = id
        node2set_id[y] = id

        # グループIDに対するセットを追加
        set_id2nodes[id] |= {x, y}

    # どちらか一方にのみIDが振られているとき(片方が0になる)
    elif node2set_id[x] * node2set_id[y] == 0:
        id = node2set_id[x] + node2set_id[y]
        node2set_id[x] = id
        node2set_id[y] = id
        set_id2nodes[id] |= {x, y}

    # 両方振られているとき
    else:
        # 同じIDならそもそも考える必要がない
        if node2set_id[x] - node2set_id[y] == 0:
            continue

        # 異なるグループのときにはマージする
        id = node2set_id[x]
        prev_y = node2set_id[y]

        # yが所属するグループIDをすべてxのものに置き換える
        for y_idx in set_id2nodes[node2set_id[y]]:
            node2set_id[y_idx] = id
            set_id2nodes[id] |= {y_idx}

        del set_id2nodes[prev_y]


num = sum([len(m)-1 for m in set_id2nodes.values()])

print(N - num)
N = int(input())
A = tuple(map(int, input().split()))
B = tuple(map(int, input().split()))

if len([0 for a, b in zip(A, B) if a != b]) == 0:
    print(N)
    exit()

if len([0 for a, b in zip(A, B) if a > b]) == 1:
    M = N
    i = [i for i, (a, b) in zip(A, B) if a > b][0]

    for k in range(N // A[i] + 1):
        D = N - k * A[i]
        D += k * B[i]
        M = max(M, D)

    i, j = [i for i, (a, b) in zip(A, B) if not a > b]
    ans = M
    for k in range(N // B[i] + 1):
        D = M - k * B[i]
        l, D = divmod(D, B[j])

        D += k * A[i]
        D += l * A[j]

        ans = max(ans, D)

    print(ans)
    exit()

if len([0 for a, b in zip(A, B) if a > b]) == 2:
    M = N

    i, j = [i for i, (a, b) in zip(A, B) if not a > b]
    for k in range(N // B[i] + 1):
        D = N - k * B[i]
        l, D = divmod(D, B[j])

        D += k * A[i]
        D += l * A[j]

        M = max(M, D)

    i = [i for i, (a, b) in zip(A, B) if a > b][0]
    ans = M
    for k in range(N // A[i] + 1):
        D = M - k * A[i]
        D += k * B[i]
        ans = max(ans, D)

    print(ans)
    exit()

def calc(fr, to):
    ret = N
    for g in range(N // fr[0] + 1):
        for s in range(N // fr[1] + 1):
            D = N - g * fr[0] - s * fr[1]

            if D < 0:
                break

            q, r = divmod(D, fr[2])

            D += g * to[0]
            D += s * to[1]

            r += g * to[0]
            r += s * to[1]
            r += q * to[2]

            ret = max(ret, D, r)
    return ret

print(calc(A, B))


### FIXED CODE ###

N = int(input())
A = tuple(map(int, input().split()))
B = tuple(map(int, input().split()))

def calc(A, B, N):
    M = N
    if len([i for i, (a, b) in enumerate(zip(A, B)) if a < b]) == 1:
        i = [i for i, (a, b) in enumerate(zip(A, B)) if a < b][0]

        for k in range(N // A[i] + 1):
            D = N - k * A[i]
            if D < 0:
                continue

            D += k * B[i]
            M = max(M, D)
    elif len([i for i, (a, b) in enumerate(zip(A, B)) if a < b]) == 2:
        i, j = [i for i, (a, b) in enumerate(zip(A, B)) if a < b]

        for k in range(N // A[i] + 1):
            D = N - k * A[i]
            l, D = divmod(D, A[j])

            D += k * B[i]
            D += l * B[j]

            M = max(M, D)
    elif len([i for i, (a, b) in enumerate(zip(A, B)) if a < b]) == 3:
        for g in range(N // A[0] + 1):
            for s in range(N // A[1] + 1):
                D = N - g * A[0] - s * A[1]

                if D < 0:
                    break

                q, r = divmod(D, A[2])

                D += g * B[0]
                D += s * B[1]

                r += g * B[0]
                r += s * B[1]
                r += q * B[2]

                M = max(M, D, r)
    return M

print(calc(B, A, calc(A, B, N)))
nv,ne = [int(i) for i in input().split()]

g = [[] for i in range(nv)]

for i in range(ne):
    s,t = [int(j) for j in input().split()]
    g[s].append(t)

visited = [False for i in range(nv)]
f = 0

def pursue_from(index):
    global f


    if visited[index]:
        return

    visited[index] = True

    for next_index in g[index]:

        if next_index == 0:
            f = 1
            return
        pursue_from(next_index)

pursue_from(0)

print(f)


### FIXED CODE ###

import math

c1x,c1y,c1r = [int(i) for i in input().split()]
c2x,c2y,c2r = [int(i) for i in input().split()]

d = math.sqrt(pow(c1x-c2x, 2) +  pow(c1y-c2y, 2))

bcr = 0
scr = 0

if c1r > c2r:
    bcr = c1r
    scr = c2r
else:
    bcr = c2r
    scr = c1r


if d > bcr + scr:
    print(4)
elif d == bcr + scr:
    print(3)
elif d + scr > bcr:
    print(2)
elif d + scr == bcr:
    print(1)
else:
    print(0)
s=input()
d=[]
n=len(s)
ans=0
for i in range(1<<n):
    tmp=0
    for j in range(n):
        if (i>>j)&1:
            ans+=int(s[tmp:j+1])
            tmp=j+1
    ans+=int(s[tmp:])

print(ans)


### FIXED CODE ###

s=input()
n=len(s)
n-=1
ans=0
for i in range(1<<n):
    tmp=0
    for j in range(n):
        if (i>>j)&1:
            ans+=int(s[tmp:j+1])
            tmp=j+1
    ans+=int(s[tmp:])
print(ans)
n,q=map(int,input().split())
G=[[] for i in range(n)]
for i in range(n-1):
    a,b=map(int,input().split())
    G[a-1].append(b-1)
    G[b-1].append(a-1)

add=[0]*n
for i in range(q):
    p,x=map(int,input().split())
    add[p-1]+=x

ans=[0]*n

check=[False]*n
temp=0
def dfs(v):
    global temp

    check[v]=True
    temp+=add[v]
    ans[v]=temp

    for next in G[v]:
        if check[next]:
            continue
        dfs(next)
    
    temp-=add[v]

dfs(0)

print(*ans)



### FIXED CODE ###

from collections import deque

N,Q=map(int,input().split())
L=[[] for _ in range(N+1)]
for i in range(N-1):
    a,b=map(int,input().split())
    L[a].append(b)
    L[b].append(a)
count=[0]*(N+1)
for j in range(Q):
    p,x=map(int,input().split())
    count[p]+=x

#print(count)

q=deque() #queueとして(popleftとappend)
q.append(1)
parent=[-1]*(N+1)
#parent[1]=1

while q:
    now=q.popleft()
    for k in L[now]:
        if parent[now]==k:
            continue
        count[k]+=count[now]
        parent[k]=now
        q.append(k)
        #print(parent)

print(*count[1:])
n,k = map(int,input().split())
h = list(map(int,input().split()))
h.sort(reverse=True)
if h[-1] > k:
    ans = n
else:
    for i in range(n):
        if h[i] < k:
            ans = i
            break
print(ans)

### FIXED CODE ###

n,k = map(int,input().split())
h = list(map(int,input().split()))
ans = 0
for i in h:
  if i >= k:
    ans += 1
print(ans)
n = int(input())
a = []
b = []
flag = 0
for i in range(n):
	a.append([int(n) for n in input().split()])
	a[i][0], a[i][2] = a[i][2], a[i][0]
a = sorted(a)
for i in range(0, 101):
	for j in range(0,101):
		h = a[0][0] + abs(i - a[0][2]) + abs(j - a[0][1])
		for k in range(n):
			d = h - abs(i - a[k][2]) - abs(j - a[k][1])
			if (d >= 0 and d != a[k][0]) or (d < 0 and a[k][0] != 0):
				break
			if k == n - 1:
				b.append(i)
				b.append(j)
				b.append(h)
print(b[0], b[1], b[2])

### FIXED CODE ###

n = int(input())
a = []
for i in range(n):
	a.append([int(n) for n in input().split()])
	a[i][0], a[i][2] = a[i][2], a[i][0]
a = sorted(a)
for x in range(101):
	for y in range(101):
		h = a[n - 1][0] + abs(x - a[n - 1][2]) + abs(y - a[n - 1][1])
		for k in range(n):
			d = h - abs(x - a[k][2]) - abs(y - a[k][1])
			if a[k][0] != max(d, 0):
				break
			if k == n - 1:
				print(x, y, h)
				exit()
N,M = map(int,input().split())
abc = []
for _ in range(M):
    abc.append(list(map(int,input().split())))

cost = [-float('inf')]*N
cost[0] = 0

for i in range(2):
    for a,b,c in abc:
        a,b = a-1,b-1
            cost[b] = max(cost[b], cost[a] + c)
                
    if i == 0:
        ans = cost[N-1]
    else:
        Max = cost[N-1]


if ans != Max:
    print('inf')
else:
    print(ans)


### FIXED CODE ###

N,M = map(int,input().split())

from collections import deque
ls = [deque([]) for _ in range(N)]

for i in range(M):
    a,b,c = map(int,input().split())
    a,b = a-1,b-1
    ls[a].append([b,c])
cost = [-(10**10)*N]*N
cost[0] = 0

for i in range(N):
    update = False
    q = [deque(m for m in l) for l in ls]
    for j in range(N):
        if cost[j] != -(10**10)*N:
            while q[j]:
                b,c = q[j].pop()
                if cost[b] < cost[j] + c:
                    cost[b] = cost[j] + c
                    update = True
    if i == 0:
        Max = cost[N-1]
    elif i < N-1:
        Max = max(Max,cost[N-1])

if update == True and Max < cost[N-1]:
    print('inf')
else:
    print(Max)
h, a = map(int, input().split)

print(int(h/a))

### FIXED CODE ###

h, a = map(int, input().split())

if h%a == 0:
  print((int)(h/a))
else:
  print((int)(h/a)+1)
# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub

sys.setrecursionlimit(100000)
input = sys.stdin.readline
INF = 2**62-1

def read_int():
    return int(input())


def read_int_n():
    return list(map(int, input().split()))


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input().strip()


def read_str_n():
    return list(map(str, input().split()))


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(N, M, SC):
    ans = 0
    number = [None] * M
    for s, c in SC:
        if number[s-1] is None:
            number[s-1] = c
        elif number[s-1] != c:
            return -1

    if number[0] == 0:
        return -1
    if number[0] is None:
        number[0] = 1

    for i in range(M):
        if number[i] is None:
            number[i] = 0

    return int(''.join(map(str, number)))


def main():
    N, M = read_int_n()
    SC = [read_int_n() for _ in range(M)]
    print(slv(N, M, SC))


if __name__ == '__main__':
    main()


### FIXED CODE ###

# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub

sys.setrecursionlimit(100000)
input = sys.stdin.readline
INF = 2**62-1

def read_int():
    return int(input())


def read_int_n():
    return list(map(int, input().split()))


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input().strip()


def read_str_n():
    return list(map(str, input().split()))


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(N, M, SC):

    for i in range(1000):
        i = str(i)
        if len(i) != N:
            continue

        for s, c in SC:
            if int(i[s-1]) != c:
                break
        else:
            return i


    return -1


def main():
    N, M = read_int_n()
    SC = [read_int_n() for _ in range(M)]
    print(slv(N, M, SC))


if __name__ == '__main__':
    main()
N = int(input())
T = list(map(int, input().split()))
M = int(input())

for _ in range(M):
    t = T.copy()
    P, X = map(int, input().split())
    t[P - 1] = X
    print(sum(t))


### FIXED CODE ###

N = int(input())
T = list(map(int, input().split()))
M = int(input())

for _ in range(M):
    t = T.copy()
    P, X = map(int, input().split())
    t[P - 1] = X
    print(sum(t))
s = input()
t = input()

result = []
for i in range(len(s)-len(t)+1):
    temp = '?'*i + t + '?'*(len(s)-len(t)-i)
    
    ans = ''
    flag = True
    for j in range(len(s)):
        if s[j] == '?' or s[j] == temp[j]:
            ans += temp[j]
        elif s[j] != '?' and temp[j] == '?':
            ans += s[j]
        else:
            flag = False

    if flag:
        result.append(ans)

if ans:
    result.sort()
    print(result[0])
else:
    print("UNRESTORABLE")

### FIXED CODE ###

s = input()
t = input()

result = []
for i in range(len(s)-len(t)+1):
    temp = '?'*i + t + '?'*(len(s)-len(t)-i)
    
    ans = ''
    flag = True
    for j in range(len(s)):
        if s[j] == '?' or s[j] == temp[j]:
            ans += temp[j]
        elif s[j] != '?' and temp[j] == '?':
            ans += s[j]
        else:
            flag = False

    if flag:
        result.append(ans.replace('?', 'a'))

if result:
    result.sort()
    print(result[0])
else:
    print("UNRESTORABLE")
n, m, x = map(int, input().split())
a = map(int, input().split())
print(min(sum([1 for i in a if i>x]),sum([1 for i in a if i<x]))

### FIXED CODE ###

n, m, x = map(int, input().split())
a = list(map(int, input().split()))
print(min(sum([1 for i in a if i>x]),sum([1 for i in a if i<x])))
N, M = list(map(int, input().split()))
D = list(map(int, input().split()))
UB = [list(map(int, input().split())) for _ in range(M)]

R = {}
for i in range(M):
  a, b = UB[i]
  a -= 1
  b -= 1
  if a not in R: R[a] = [[b, i]]
  else: R[a].append([b, i])
  if b not in R: R[b] = [[a, i]]
  else: R[b].append([a, i])

DD = [[0] * 2 for _ in range(N)]
for i in range(N):
  DD[i][0] = D[i]
  DD[i][1] = i
DD.sort()
L = [0] * N
H = [0] * M
LL = [[-1] * 2 for _ in range(N)]
for i in range(N):
  h, x = DD[i]
  if L[x] == 0:
    if LL[x][0] == -1:
      for n, m in R[x]:
        LL[n] = [x, h]
        if D[n] == D[x] or L[n] != 0:
          H[m] = h
          if L[n] == 1:
            L[n] = 1
            L[x] = 2
          else:
            L[n] = 2
            L[x] = 1
          break
      else:
        print(-1)
        exit()
    else:
      n, m = LL[x]
      H[m] = h
      if L[n] == 1:
        L[n] = 1
        L[x] = 2
      else:
        L[n] = 2
        L[x] = 1

t = ""
for i in range(N):
  if L[i] == 1:
    t += "B"
  else:
    t += "W"
print(t)
for i in range(M):
  if H[i] == 0:
    print(10 ** 9)
  else:
    print(H[i])


### FIXED CODE ###

import sys
input = sys.stdin.readline
N, M = list(map(int, input().split()))
D = list(map(int, input().split()))
UB = [list(map(int, input().split())) for _ in range(M)]

LL = [[-1] * 2 for _ in range(N)]
for i in range(M):
  a, b = UB[i]
  a -= 1
  b -= 1
  if D[a] < D[b]:
    LL[b] = [a, i]
  elif D[a] > D[b]:
    LL[a] = [b, i]
  else:
    LL[a] = [b, i]
    LL[b] = [a, i]

DD = [[0] * 2 for _ in range(N)]
for i in range(N):
  DD[i][0] = D[i]
  DD[i][1] = i
DD.sort()
L = [0] * N
H = [0] * M

for i in range(N):
  h, x = DD[i]
  if L[x] == 0:
    if LL[x][0] == -1:
      print(-1)
      exit()
    else:
      n, m = LL[x]
      H[m] = h
      if L[n] == 1:
        L[n] = 1
        L[x] = 2
      else:
        L[n] = 2
        L[x] = 1

for i in range(N):
  if L[i] == 1:
    L[i] = "B"
  else:
    L[i] = "W"
print("".join(list(map(str, L))))
for i in range(M):
  if H[i] == 0:
    print(10 ** 9)
  else:
    print(H[i])
def pow_mod(a, n, m): # (a^n) % m
    res = 1
    while n > 0:
        if n % 2 == 1:
            res = (res * a) % m
        a = (a * a) % m
        n = n // 2
    return res

def combi_mod(p, q, m):
    numerator, denominator = 1, 1
    for i in range(1, q+1):
        numerator *= (p - i + 1)
        numerator %= m
        denominator *= i
        denominator %= m
    return numerator * pow_mod(denominator, m-2, m) % m

n, a, b = list(map(int, input().split()))
res = pow_mod(2, n, M) - 1
res -=combi_mod(n, a, M)
if res < 0:
    res += M
res -= combi_mod(n, b, M)
if res < 0:
    res += M
print(res)

### FIXED CODE ###

M = pow(10, 9) + 7

def pow_mod(a, n, m): # (a^n) % m
    res = 1
    while n > 0:
        if n % 2 == 1:
            res = (res * a) % m
        a = (a * a) % m
        n = n // 2
    return res

def combi_mod(p, q, m):
    numerator, denominator = 1, 1
    for i in range(1, q+1):
        numerator *= (p - i + 1)
        numerator %= m
        denominator *= i
        denominator %= m
    return numerator * pow_mod(denominator, m-2, m) % m

n, a, b = list(map(int, input().split()))
res = pow_mod(2, n, M) - 1
res -=combi_mod(n, a, M)
if res < 0:
    res += M
res -= combi_mod(n, b, M)
if res < 0:
    res += M
print(res)
a = map(float, raw_input().split())

Pi = 3.141592658979

print a*a*Pi, 2*a*Pi

### FIXED CODE ###

import math

a = float(input())

print("%f %f" % (a*a*math.pi, 2*a*math.pi))
n=input()
if n.isuper() == true :
  print(n.lower())
else:
  print(n.upper())
	

### FIXED CODE ###

n = input()
if n.isupper():
  print("A")
else:
  print("a")
while True:
    try:
        n = int(raw_input())
        filter = [1 for i in range(n)]
        filter[0] = 0
        for i in range(1:n):
            j = 2
            while k < n:
                k = i*j
                filter[k-1] = 0
                j += 1
        count = 0
        do i in filter:
            sum += i
        print sum
    except:
        break

### FIXED CODE ###

import math
n = []
while True:
    try:
        n.append(int(raw_input()))
    except:
        break
  
r = max(n)+1
sqrt = int(math.sqrt(r))
p = [1]*r
p[0] = 0
p[3::2] = [0 for x in range(3,r,2)]
for i in range(2,sqrt,2):
    if p[i]:
        p[2*i+1::i+1] = [0 for x in range(2*i+1,r,i+1)] 
  
for i in n:
     print sum(p[:i])