Harryxun/stf_run huggingface dataset:
# keyence2019C - Exam and Wizard
def main():
    N, *AB = map(int, open(0).read().split())
    ans, shortage, pos = 0, 0, []
    for i, j in zip(AB[:N], B[N:]):
        x = i - j
        if x >= 0:
            pos.append(x)
        else:
            ans += 1
            shortage += x
    for i in sorted(pos, reverse=1):
        if shortage >= 0:
            break
        ans += 1
        shortage += i
    flg = shortage >= 0
    print(ans if flg else -1)  # -1: shoratage still remains


if __name__ == "__main__":
    main()

### FIXED CODE ###

# keyence2019C - Exam and Wizard
def main():
    N = int(input())
    A = tuple(map(int, input().split()))
    B = tuple(map(int, input().split()))
    dif = sorted(i - j for i, j in zip(A, B))
    ans, shortage = 0, 0
    for i in dif:
        if i < 0:
            ans += 1
            shortage += i
        else:
            break
    for i in dif[::-1]:
        if shortage >= 0:
            print(ans)
            return
        ans += 1
        shortage += i
    print(-1)


if __name__ == "__main__":
    main()
class CookieCalc:
  def __init__(self, t_cookie, a_cookie):
    self.takahashi_cookie = t_cookie
    self.aoki_cookie = a_cookie
    
  def eat_cookie(self):
    if self.takahashi_cookie > 0:
      self.takahashi_cookie-=1
    elif self.aoki_cookie > 0:
      self.aoki_cookie -= 1
      
  def sum_cookie(self):
    return self.takahashi_cookie + self.aoki_cookie
      
t_cookie,a_cookie,K = [int(s) for s in input().split()]
cookie = CookieCalc(t_cookie, a_cookie)
 
for i in range(K):
  cookie.eat_cookie()
  if cookie.sum_cookie() == 0:
    break
    
  
print(cookie.takahashi_cookie, cookie.aoki_cookie)  

### FIXED CODE ###

s, t = input().split()
print(t + s)
import random
from collections import defaultdict
from itertools import accumulate
import sys
input = sys.stdin.readline
n = int(input())
s = input().rstrip()
mod = (1<<61)-1
base = 1000+random.randint(0,100)
power = [1]
for i in range(1,n):
  power.append((power[-1]*base)%mod)
hvalue = [0]
for i in range(n):
  hvalue.append((hvalue[-1]+(ord(s[i])*power[i]))%mod)
def rollinghash(l,r):
  return ((hvalue[r]-hvalue[l])*power[n-r])%mod
def pun(i):
  dc = defaultdict(int)
  if i>n//2:
    return False
  for j in range(n-i+1):
    x = rollinghash(j,i+j)
    if dc[x]:
      rg =dc[x]
      if rg<=j:
        return True
      else:
        dc[x] = i+j
  return False
l=0
r=n//2+1
while l+1<r:
  mi=(l+r)//2
  if pun(mi):
    l=mi
  else:
    r=mi
print(l)


### FIXED CODE ###

x=input()
if x=="Sunny":
  print("Cloudy")
if x=="Cloudy":
  print("Rainy")
if x=="Rainy":
  print("Sunny")
s = input()
n = len(s)
up = []
down = []
for i in range(1,n):
  if s[i] != s[i-1]:
    if s[i] == 'L':
      down.append(i)
    else:
      up.append(i)
ans = [0 for _ in range(n)]
top = up[0]
bottom = down[0]
count = 0
for i in range(n):
  diff = i - bottom
  if diff % 2 == 0:
    ans[bottom] += 1
  else:
    ans[bottom-1] += 1
  #print(ans)
  if i+1 == top:
    count += 1
    try:
      top = up[count]
    except:
      pass
    bottom = down[count]
print(' '.join(map(str,ans)))

### FIXED CODE ###

s = input()
n = len(s)
up = []
down = []
parity = 0
for i in range(1,n):
  if s[i] != s[i-1]:
    if parity == 0:
      down.append(i)
    else:
      up.append(i)
    parity = 1 - parity
ans = [0 for i in range(n)]
#print(up,down)
for i in range(n):
  if s[i] == 'R':
    diff = down[0] - i
    if diff % 2 == 1:
      ans[down[0]-1] += 1
    else:
      ans[down[0]] += 1
  else:
    diff = i - down[0]
    if diff % 2 == 1:
      ans[down[0]-1] += 1
    else:
      ans[down[0]] += 1
  if up != []:
    if i+1 == up[0]:
      del down[0]
      del up[0]
ANS = list(map(str,ans))
print(' '.join(ANS))
a,b,t=map(int,input().split())
print(((2t+1)//2a)*b)


### FIXED CODE ###

a,b,t=map(int,input().split())
print(t//a*b)
a,b=int(input().split())
print(a+b //2 if a+b % 2==0 else 'IMPSSIBLE')

### FIXED CODE ###

a,b=map(int,input().split());print((a+b)//2 if (a+b)%2==0 else 'IMPOSSIBLE')
N = int(input())
if N % 7 == 0:
  print('Yes')
else:
  while(N>0):
  	if N%4 == 0:
    	print('Yes')
    	break
  	else:
    	N = N - 7
  else:
  	print('No')


### FIXED CODE ###

N = int(input())
if N % 7 == 0:
  print('Yes')
else:
  while(N>0):
    if N%4 == 0:
      print('Yes')
      break
    else:
      N = N - 7
  else:
    print('No')
A, B, K = input().split()

C = int(K)-int(A)
if(C >= 0):
    B = int(B)-C
    A = 0
else:
    A = int(A)-int(break)

print(str(A) +" "+ str(B))

### FIXED CODE ###

A, B, K = input().split()
C = int(K)-int(A)
D = int(K)-int(B)

if(int(A)==0):
    if(int(B)==0):
        print(str(A) +" "+ str(B))
    else:
        if(D>=0):
            B = 0
        else:
            B = -D
        print(str(A) +" "+ str(B))
else:
    if(C >= 0):
        B = int(B)-C
        A = 0
        if(B<0):
            B = 0
    else:
        A = int(A)-int(K)
    print(str(A) +" "+ str(B))
# -*- coding: utf-8 -*-
n = int(input())
edge = [[] for _ in range(n+1)]
for _ in range(n-1):
    a,b = map(int, input().split())
    edge[a].append(b)
    edge[b].append(a)

inf = 10**5

def bfs(visited, s):
    for e in edge[s]:
        if visited[e]==inf:
            visited[e] = visited[s]+1
            bfs(visited, e)


fvisited = [inf for _ in range(n+1)]
fvisited[n] = 0
bfs(fvisited, n)

svisited = [inf for _ in range(n+1)]
svisited[1] = 0
bfs(svisited, 1)

# print(fvisited)
# print(svisited)
fcnt = 0
scnt = 0
for i in range(1,n+1):
    if fvisited[i]<svisited[i]:
        fcnt += 1
    else:
        scnt += 1

if fcnt<scnt:
    print("Fennec")
else:
    print("Snuke")


### FIXED CODE ###

# -*- coding: utf-8 -*-
from collections import deque
n = int(input())
edge = [[] for _ in range(n+1)]
for _ in range(n-1):
    a,b = map(int, input().split())
    edge[a].append(b)
    edge[b].append(a)

inf = 10**6


fvisited = [inf for _ in range(n+1)]
fvisited[1] = 0
q = deque([1])
while len(q)>0:
    s = q.popleft()
    for e in edge[s]:
        if fvisited[e]==inf:
            fvisited[e] = fvisited[s]+1
            q.append(e)

svisited = [inf for _ in range(n+1)]
svisited[n] = 0
q = deque([n])
while len(q)>0:
    s = q.popleft()
    for e in edge[s]:
        if svisited[e]==inf:
            svisited[e] = svisited[s]+1
            q.append(e)

# print(fvisited)
# print(svisited)
fcnt = 0
scnt = 0
for i in range(1,n+1):
    if fvisited[i]<=svisited[i]:
        fcnt += 1
    else:
        scnt += 1

if fcnt>scnt:
    print("Fennec")
else:
    print("Snuke")
T = list(str(input()))

for i in range(len(T)):
    if T[i] == '?':
        if T[i - 1] == 'P':
            T[i] = 'D'
        elif T[i + 1] == '?':
            T[i] = 'P'
            T[i + 1] = 'D'
            i= i+1
        else:
            T[i] = 'D'
        

TL=''.join(T)
print(TL)


### FIXED CODE ###

T = list(str(input()))

for i in range(len(T)):
    if T[i] == '?':
        T[i] = 'D'
    print(T[i],end='')
def eratosthenes(limit):
    import math
    A = [i for i in range(2, limit+1)]
    P = []
    time = 0
    while True:
        prime = min(A)
        if prime > math.sqrt(limit): break
        P.append(prime)
        i = 0
        while i < len(A):
            if A[i] % prime == 0:
                A.pop(i)
                continue
            i += 1
    for a in A: P.append(a)
    return P
L = eratosthenes(10**5)
ans = [0]*(10**5+1)
d = [0]*(10**5+1)
for i in l: d[i] += 1
for i in range(2, 10**5+1):
    ans[i] += ans[i-1]
    if i%2==1 and d[(i+1)//2]: ans[i] += 1
for _ in range(int(input())):
    l, r = map(int, input().split())
    print(ans[r]-ans[l-1])
            

### FIXED CODE ###

def eratosthenes(limit):
    A = [i for i in range(2, limit+1)]
    P = []
    time = 0
    while True:
        prime = min(A)
        if prime > 316: break
        P.append(prime)
        i = 0
        while i < len(A):
            if A[i] % prime == 0:
                A.pop(i)
                continue
            i += 1
    for a in A: P.append(a)
    return P
l = eratosthenes(10**5)
ans = [0]*(10**5+1)
d = [0]*(10**5+1)
for i in l: d[i] += 1
for i in range(2, 10**5+1):
    ans[i] += ans[i-1]
    if i%2==1 and d[i] and d[(i+1)//2]: ans[i] += 1
for _ in range(int(input())):
    l, r = map(int, input().split())
    print(ans[r]-ans[l-1])
H, A = int(input().split())
n = H+A-1//A
print(n)

### FIXED CODE ###

H, A = map(int, input().split())
n = (H+A-1)//A
print(n)
H, W = map(int, input().split())
C_list = []
for _ in range(W):
    temp_list = input()
    print(temp_list)
    print(temp_list)

### FIXED CODE ###

H, W = map(int, input().split())
c=[input() for _ in range(H)]
for _ in c:
    print(_ + "\n" + _)
X = int(input(X))

a = X // 100
b = X % 100

m = 5*a

if b > m:
  print(0)
else:
  print(1)

### FIXED CODE ###

X = int(input())

a = X // 100
b = X % 100

m = 5*a

if b > m:
  print(0)
else:
  print(1)
(n,m),*e=[[*map(int, t.split())] for t in input()]
t=[[]for _ in range(n+1)]
for a,b in e:t[a]+=[b];t[b]+=[a]
q=[1]
a=[0]*-~n
while q:q=[a[j]==0and(a.__setitem__(j,i)or j)for i in q for j in t[i]]
print('Yes',*a[2:])

### FIXED CODE ###

(n,m),*e=[[*map(int, t.split())] for t in open(0)]
t=[[]for _ in range(n+1)]
for a,b in e:t[a]+=[b];t[b]+=[a]
q=[1]
a=[0]*-~n
while q:q=[a[j]==0and(a.__setitem__(j,i)or j)for i in q for j in t[i]]
print('Yes',*a[2:])
# -*- coding: utf-8 -*-
N=int(input())
S, T=map(list, input().split())
W=[]
for i in range(N)
    W.append(S[i-1])
    W.append(T[i-1])

W=str(W)
print(W)

### FIXED CODE ###

# -*- coding: utf-8 -*-
N=int(input())
S, T=map(list, input().split())
W=""
for i in range(N):
    W=W+S[i]
    W=W+T[i]

print(W)
A,B = map(int,input().split())
N=0

if(B-A)%2=1:
  print("IMPOSSIBLE")
  
else:
  print((B-A)//2)

### FIXED CODE ###

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

if (B%2!=A%2):
  print("IMPOSSIBLE")
  
else:
  print((B+A)//2)
import sys,math,collections,itertools
input = sys.stdin.readline

N,K,S=list(map(int,input().split()))
ans = [0]*N
if S !=10**9-1:
    ans[K]=10**9-1
else:
    ans[K]=10**9-2
ans[0]=S

print(*ans)


### FIXED CODE ###

import sys,math,collections,itertools
input = sys.stdin.readline

N,K,S=list(map(int,input().split()))
if S == 10**9:
    ans = [10**9-1]*N
else:
    ans = [10**9]*N
for i in range(K):
    ans[i]=S
print(*ans)
i = 0
n = (int)raw_input()
while (!n):
  i = i+1
  print 'Case {0}: {1}'.format(i,n)
  n = (int)raw_input()

### FIXED CODE ###

n = input()
i = 1
while n != 0:
  print "Case %d: %d" % (i, n)
  n = input()
  i += 1;
n,m = map(int,input().spit())
if n == m:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

n,m = map(int,input().split())
if n == m:
  print("Yes")
else:
  print("No")
N = int(input())
x = [0] * N
u = [0] * N
for i in range(N):
    x[i],u[i] = map(str, input().split())


ans = []

btc_1 = 380000.0

for i  in range(N):
    if u[i] == "JPY":
        ans.append(x[i])
    else:
        yen = ((x[i])*(btc_1))
        ans.append(yen)

print(sum(ans))

### FIXED CODE ###

N=int(input())
ans=0
for i in range(N):
    x,u=map(str,input().split())
    x=float(x)
    if u=="JPY":
        ans+=x
    else:
        ans+=380000.0*x
print(ans)
import copy

n = int(input())
list1 = list(map(int,input().split()))
list2 = copy.copy(list1) 　　#全体の組み合わせ計算
list3 = copy.copy(list1)    #K番目の数字との組み合わせ計算

kei1=0
kei2=0

for x in range(n):
    l = list2.pop(0)
    if l in list2:
        kei1 += list2.count(l)

    k = list3.pop(x)
    if k in list3:
        kei2 += list3.count(k)

    print(kei1-kei2)

### FIXED CODE ###

import collections

n = int(input())
list1 = list(map(int,input().split()))
list2 = collections.Counter(list1)

kei1=0

for j in list2.values():
    kei1 += j * (j-1) // 2

for x in list1:
    print(kei1 - (list2[x] -1))
S = list(input())
count = 0
for w in S:
    if w == 'R':
        count += 1
    else:
        ans = count
        count = 0
print(ans) if count < ans else print(count)


### FIXED CODE ###

S = list(input())
count = 0
ans = 0
for w in S:
    if w == 'R':
        count += 1
        
    else:
        count = 0
    if count > ans:
        ans = count
print(ans)
a,b,c,d,e,f=map(int,input().split())
w=set([])
for i in range(31):
    for j in range(31):
        x=a*i*100+b*j*100
        if 0<x<=f:
            w.add(x)
s=set([])
for i in range(3001):
    for j in range(3001):
        y=c*i+d*j
        if y<=f:
            s.add(y)
tmpn=0
for i in w:
    for j in s:
        if i+j<=f and i//100*e>=j:
            if tmpn<j/(1.0*(i+j)):
                tmpn=j/(1.0*(i+j))
                ans=[i,j]
print(*ans)


### FIXED CODE ###

a,b,c,d,e,f=map(int,input().split())
w=set([])
for i in range(31):
    for j in range(31):
        x=a*i*100+b*j*100
        if 0<x<=f:
            w.add(x)
s=set([])
for i in range(3001):
    for j in range(3001):
        y=c*i+d*j
        if y<=f:
            s.add(y)
tmpn=-1
ans=[0,0]
for i in w:
    for j in s:
        if i+j<=f and i//100*e>=j:
            if tmpn<j/(1.0*(i+j)):
                tmpn=j/(1.0*(i+j))
                ans=[i+j,j]
print(*ans)
from sys import stdin
import bisect

n,t = [int(x) for x in stdin.readline().rstrip().split()]
li = [list(map(int,stdin.readline().rstrip().split())) for _ in range(n)]
li2 = []
for i in range(n):
    if li[i][0] <= t:
        li2.append(li[i][0])

li2.sort()

print(li2[0])

### FIXED CODE ###

from sys import stdin
import bisect

n,t = [int(x) for x in stdin.readline().rstrip().split()]
li = [list(map(int,stdin.readline().rstrip().split())) for _ in range(n)]
li2 = []
for i in range(n):
    if li[i][1] <= t:
        li2.append(li[i][0])
if len(li2) == 0:
    print("TLE")
    exit()
li2.sort()
print(li2[0])
S=input()
T=input()
i=0
j=0
match = 0
for i in range(Len(S)-Len(T)):
  count = 0
  for j in range(Len(T)):
    if S[i+j]==T[j]:
      count=count+1
  
  if match<count:
    match=count

print(Len(T)-match)
      

### FIXED CODE ###

S=input()
T=input()
match=0
for i in range(len(S)-len(T)+1):
    count=0
    for j in range(len(T)):
        if S[i+j]==T[j]:
            count=count+1
    if match<count:
        match=count
print(len(T)-match)
from math import log2, floor

H = int(input())

a = 0
for i in range(floor(log2(H)) + 1):
    a += 2 ** i
print(a)


### FIXED CODE ###

from math import log, floor

H = int(input())

a = 0
for i in range(floor(log(H, 2)) + 1):
    a += 2 ** i
print(a)
print(3*(int(input())**2)

### FIXED CODE ###

print(3*int(input())**2)
a, b = map(int, input().split())
print(math.ceil((a + b) / 2))

### FIXED CODE ###

import math
a, b = map(int, input().split())
print(math.ceil((a + b) / 2))
n = int(input())
ans = "No"
for i in range(n // 7 + 1):
  if (n - i*7) % 4 == 0:
    ans == "Yes"
    break
print(ans)


### FIXED CODE ###

import math
n,k = map(int, input().split())
print(math.ceil(n/k)-n//k)
N = int(input())

if N%2==1:
    print("First")
    exit()
elif N==2:
    print("Second")
    exit()

E = [[] for _ in range(N+1)]
for _ in range(N-1):
    a, b = map(int, input().split())
    E[a].append(b)
    E[b].append(a)

E_dim = [len(e) for e in E]
E_set = [set(e) for e in E]
q = []
for v, (dim, e) in enumerate(zip(E_dim, E)):
    if dim==1:
        for u in e:
            if E_dim[u] == 2:
                q.append(v)
                
while q:
    v = q.pop()
    u = E[v][0]
    if E_dim[u] == 1:
        print("Second")
        exit()
    E_set[u].remove(v)
    w = E_set[u].pop()
    E_set[w].remove(u)
    E_dim[w] -= 1
    if E_dim[w] == 1:
        x = E_set[w].copy().pop()
        if E_dim[x] == 2:
            q.append(w)
    elif E_dim[w] == 2:
        for x in E_set[w]:
            if E_dim[x] == 1:
                q.append(x)
print("First")



### FIXED CODE ###

N = int(input())

if N%2==1:
    print("First")
    exit()
elif N==2:
    print("Second")
    exit()

E = [[] for _ in range(N+1)]
for _ in range(N-1):
    a, b = map(int, input().split())
    E[a].append(b)
    E[b].append(a)

E_dim = [len(e) for e in E]
E_set = [set(e) for e in E]
q = []
for v, (dim, e) in enumerate(zip(E_dim, E)):
    if dim==1:
        for u in e:
            if E_dim[u] == 2:
                q.append(v)
                
while q:
    v = q.pop()
    u = E_set[v].pop()
    if E_dim[u] == 1:
        print("Second")
        exit()
    E_set[u].remove(v)
    w = E_set[u].pop()
    E_set[w].remove(u)
    E_dim[w] -= 1
    if E_dim[w] == 1:
        x = E_set[w].copy().pop()
        if E_dim[x] == 2:
            q.append(w)
    elif E_dim[w] == 2:
        for x in E_set[w]:
            if E_dim[x] == 1:
                q.append(x)
print("First")
if S == RRR
	print("3")
elif S == SSS
	print("0")
elif S == RRS
	print("2")
elif S == SRR
	print("2")
else 
	print("1")


### FIXED CODE ###

S = input()
if S.count("R") == 3:
	print("3")
elif S.count("R") == 0:
	print("0")
elif S.count("RR") == 1:
  	print("2")
else:
	print("1")
n = int(input)
count = 0
ans = 'No'
for _ in range(n):
	a,b = map(int,input().split(' '))
    if a!=b:
    	count = 0 
    else:
    	count+=1
    if count ==3:
    	ans = 'Yes'
print(ans)     

### FIXED CODE ###

n = int(input())
count = 0
ans = 'No'
for i in range(n):
    a , b = map(int,input().split(' '))
    if a!=b:
        count = 0 
    else:
        count += 1
    if count == 3:
        ans = 'Yes'
print(ans)
import numpy as np
alp = [chr(v) for v in range(ord("a"), ord("z") + 1)]
inp = input()

if inp[::-1] == "".join(alp):
    print(-1)
    exit()

if len(inp) == len(alp):
    prev = inp[0]
    indices = [0]
    for index, char in enumerate(inp[1:]):
        if prev > char:
            indices.append(index)
        prev = char
    diff = [0] * (len(indices) - 1)
    for i, (v1, v2) in enumerate(zip(indices[1:], indices[:-1])):
        diff[i] = v1 - v2
    maxv = float("-inf")
    maxv_index = 0
    for i, d in enumerate(diff):
        if maxv <= d:
            maxv = d
            maxv_index = i

    index = indices[maxv_index + 1]
    targets = inp[index:]
    for v in sorted(targets):
        if inp[index - 1] < v:
            break
    print(inp[:index - 1] + v)

else:
    print(inp + min(set(alp) - set(list(inp))))


### FIXED CODE ###

import numpy as np
alp = [chr(v) for v in range(ord("a"), ord("z") + 1)]
inp = input()

if inp[::-1] == "".join(alp):
    print(-1)
    exit()

if len(inp) == len(alp):
    prev = inp[0]
    indices = [0]
    for index, char in enumerate(inp[1:]):
        if prev < char:
            indices.append(index)
        prev = char
    # diff = [0] * (len(indices) - 1)
    # for i, (v1, v2) in enumerate(zip(indices[1:], indices[:-1])):
    #     diff[i] = v1 - v2
    # maxv = float("-inf")
    # maxv_index = 0
    # for i, d in enumerate(diff):
    #     if maxv <= d:
    #         maxv = d
    #         maxv_index = i
    #
    # index = indices[maxv_index + 1]
    index = indices[-1]
    targets = inp[index + 1:]
    for v in sorted(targets):
        if inp[index] < v:
            break
    print(inp[:index] + v)

else:
    print(inp + min(set(alp) - set(list(inp))))
from collections import deque
a,b=map(int,input().split())
List=[]
sumup=0
for i in range(a):
  l=list(input())
  p=l.count(".")
  sumup+=p
  List.append(l)
List[0][0]=1
q=deque([[0,0]])
while List[a-1][b-1]==".":
  h,w=q.popleft()
  aaa=[[0,1],[0,-1],[1,0],[-1,0]]
  for x,y in aaa:
    if 0<=h+x<a and 0<=w+y<b:
      if List[h+x][w+y]==".":
        List[h+x][w+y]=List[h][w]+1
        q.append([h+x,w+y])
print(sumup-List[a-1][b-1])

### FIXED CODE ###

import sys
from collections import deque
sys.setrecursionlimit(10000)
a,b=map(int,input().split())
List=[]
sumup=0
for i in range(a):
  l=list(input())
  p=l.count(".")
  sumup+=p
  List.append(l)
List[0][0]=1
q=deque([[0,0]])
while q:
  h,w=q.popleft()
  aaa=[[0,1],[0,-1],[1,0],[-1,0]]
  for x,y in aaa:
    if 0<=h+x<a and 0<=w+y<b:
      if List[h+x][w+y]==".":
        List[h+x][w+y]=List[h][w]+1
        q.append([h+x,w+y])
if List[a-1][b-1]==".":
  print(-1)
else:  
  print(sumup-List[a-1][b-1])
while true:
 
  x = raw_input().split()
  a = int(x[0])
  op = x[1]
  b = int(x[2])
 
  if op == '+':
    print a+b
  elif op == '-':
    print a-b
  elif op == '*':
    print a*b
  elif op == '/':
    print a/b
  elif op == '?':
    break

### FIXED CODE ###

while 1:
 
  x = raw_input().split()
  a = int(x[0])
  op = x[1]
  b = int(x[2])
 
  if op == '+':
    print a+b
  elif op == '-':
    print a-b
  elif op == '*':
    print a*b
  elif op == '/':
    print a/b
  elif op == '?':
    break
N,M,X,Y=map(int, input().split())
x=list(map(int,input().split()))
y=list(map(int,input().split()))
print('War' if int(X-max(x))>=int(Y-max(y)) else 'No War')

### FIXED CODE ###

A,B,C=sorted(map(int,input().split()))
print(10*C+B+A)
s = input()

if s%10 == 2 or s%10 == 4 or s%10 == 5 or s%10 == 7 or s%10 == 9:
    print("hon")
elif s%10 == 0 or s%10 == 1 or s%10 == 6 or s%10 == 8:
    print("pon")
else :
    print("bon")

### FIXED CODE ###

s = int(input())

if s % 10 == 2 or s % 10 == 4 or s % 10 == 5 or s % 10 == 7 or s % 10 == 9:
    print("hon")
elif s % 10 == 0 or s % 10 == 1 or s % 10 == 6 or s % 10 == 8:
    print("pon")
else:
    print("bon")
a,b = map(int,input().split())
if a < b:
    print("a < b")
elif a > b:
    print("a > b")
else print("a == b")


### FIXED CODE ###

a,b = map(int,input().split())
if a < b:
    print("a < b")
elif a > b:
    print("a > b")
else:
    print("a == b")
import math

A, B, C, D = map(int, input().split())

bc = B // C
bd = B // D
be = B // int((C*D/math.gcd(C, D)))
BB = B - bc - bd + be

ac = (A-1) // C
ad = (A-1) // D
ae = (A-1) // int(C*D/math.gcd(C, D))
AA = (A-1) - ac - ad + ae

print(BB-AA)

### FIXED CODE ###

def gcd(x, y):
    if y == 0:
        return x
    else:
        return gcd(y, x % y)

A, B, C, D = map(int, input().split())

bc = B // C
bd = B // D
be = B // int((C*D/gcd(C, D)))
BB = B - bc - bd + be

ac = (A-1) // C
ad = (A-1) // D
ae = (A-1) // int(C*D/gcd(C, D))
AA = (A-1) - ac - ad + ae

print(BB-AA)
# -*- coding: utf-8 -*-

def solve(H, W, C):
    for i in range(2*H):
        for j in C[i]:
            print(j)
            print(j)
        

if __name__ == '__main__':
    H, W = map(int, input().split())
    C = [[input()] for i in range(H)]
  
    solve(H, W, C)

### FIXED CODE ###

# -*- coding: utf-8 -*-

def solve(H, W, C):
    for i in range(H):
        for j in list(C[i]):
            print(j)
            print(j)
        
if __name__ == '__main__':
    H, W = map(int, input().split())
    C = [[input()] for i in range(H)]
  
    solve(H, W, C)
n,x=map(int,input().split())
L = list(map(int,input().split()))
count=0
D=0
for i in range(n+2):
    if D<=x:
        D=D+L[i]     
        count+=1
    else:
        print(count)
        break

### FIXED CODE ###

n,x=map(int,input().split())
L = list(map(int,input().split()))
count=1
D=0
for i in L:
    D=D+i
    if D<=x:
        count+=1
    else:
        break
 
print(count)
n = int(input())
b=list(map(int, input().split())) 
  
sum =b[0]
for i in range(1,len(b)):
    if b[i-1]<b[i]:
        sum+=b[i-1]
    else:
        sum+=b[i]
        
sum+=b[i]
        
print(sum)

### FIXED CODE ###

n = int(input())
b=list(map(int, input().split())) 

sum =b[0]

if len(b) >= 2:
    for i in range(1,len(b)):
        if b[i-1]<b[i]:
            sum+=b[i-1]
        else:
            sum+=b[i]
        
sum+=b[-1]
        
print(sum)
A,B,C = map(int,input().split(' '))
num = 0
if A == B == C:
    print(-1)
elif A % 2 == 0 and B % 2 == 0 and C % 2 == 0:
    while A % 2 == 0 and B % 2 == 0 and C % 2 == 0:
        A_c = A
        B_c = B
        C_c = C
        A = B_c /2 + C_c / 2
        B = A_c / 2 + C_c /2
        C = A_c /2 + B_c / 2
        num += 1
    print(num)
else:
    print(0)

### FIXED CODE ###

N = int(input())
if N % 2 == 0:
  n = N / 2
else:
  n = int((N+1) / 2)
print(int(n))