Harryxun/stf_run huggingface dataset:
#!/usr/bin/env python3
import collections
import itertools as it
import math
#import numpy as np
 
s  = input()
#  = int(input())
#  = map(int, input().split())
#  = list(map(int, input().split()))
#  = [int(input()) for i in range(N)]
#
# c = collections.Counter()

query = list('keyence')

import re

for p in range(8):
    b = ''.join(query[:p])
    a = ''.join(query[p:])

    pattern = f'.*{b}.*{a}.*'
    if re.findall(pattern, s):
        print('YES')
        break
else:
    print('NO')


### FIXED CODE ###

#!/usr/bin/env python3
import collections
import itertools as it
import math
#import numpy as np
 
s  = input()
#  = int(input())
#  = map(int, input().split())
#  = list(map(int, input().split()))
#  = [int(input()) for i in range(N)]
#
# c = collections.Counter()

query = list('keyence')

import re

for p in range(8):
    b = ''.join(query[:p])
    a = ''.join(query[p:])

    pattern1 = r'{}{}'.format(b, a)
    pattern2 = r'^{}.*{}$'.format(b, a)
    #print(re.findall(pattern1, s))
    #print(re.findall(pattern2, s))
    if re.findall(pattern1, s) or re.findall(pattern2, s):
        print('YES')
        break
else:
    print('NO')
N, K = map(int, input().split())
S = input()
S[K-1] = S[K-1].lower()
print("".join(S))

### FIXED CODE ###

N, K = map(int, input().split())
S = list(input())
S[K-1] = S[K-1].lower()
print("".join(S))
k= int(input(). strip())
a, b = map(int,input().split())

num = (a-1)
while num <= b:
  num += 1
  	if num % k != 0:
      continue
    else:
      print('OK')
      break
  else:
    print('NG')

### FIXED CODE ###

k= int(input(). strip())
a, b = map(int,input().split())

if k == 1:
  print('OK')
  exit( )
else:
  pass
  
num = a
for num in range(a,b+1):
    if num % k != 0:
        num += 1
    else:
        print('OK')
        break
else:
	print('NG')
import collections


def main():
    N, K = list(map(int, input().split(' ')))
    An  = list(map(int, input().split(' ')))
    
    dic = {}
    li = []
    mae = []
    ato = []
    for i in range(len(An)):
        dic[str(i+1)] = An[i]
        li.append([i+1, An[i]])
        # mae.append(i+1)
        # ato.append(An[i])

    status = 1
    ittatokoro = [1]
    for k in range(K):
        pre_s = status
        status = dic[str(status)]
        if status not in ittatokoro:
            ittatokoro.append(status)
        else:
            ittatokoro.append(status)
            break
    # print('最後の位置:', status) # 
    # print(ittatokoro, k)
    
    # c = collections.Counter(ittatokoro).most_common()[0] # nがk回数
    # K += 1 #  saisyo 1 ni irus
    START = 0
    for i, iku in enumerate(ittatokoro):
        if iku == status:
            START = i
            break
    # print('START:', START)
    
    S_ittatoko = ittatokoro[:START]
    junkan = ittatokoro[START:-1]
    len_junkan = len(junkan)
    # print('junkan:', junkan, len_junkan, S_ittatoko)
    
    junkannmadeno_hosuu = K - START
    num_junkan_kaisuu = junkannmadeno_hosuu // len_junkan
    amari_junkan_kaisuu = junkannmadeno_hosuu % len_junkan
    # print('循環回数:', num_junkan_kaisuu, amari_junkan_kaisuu)

    total = num_junkan_kaisuu * len_junkan + amari_junkan_kaisuu
    
    nokori = junkannmadeno_hosuu - total
    print(junkan[amari_junkan_kaisuu])
    
    
    
main()




### FIXED CODE ###

import collections


def main():
    N, K = list(map(int, input().split(' ')))
    A  = list(map(int, input().split(' ')))
    
    where_li = []
    pre = 0
    for i in range(N):
        where_li.append(A[pre])
        pre = A[pre]-1
    
    len_w = len(where_li)
    a = where_li.index(A[pre])
    # print(a)
    mod_s = len_w-a # ループにかかる歩数
    # print(where_li)
    if K<=len_w:
        print(where_li[K-1])
    else:
        nokori = K - len_w
        if nokori % mod_s==0:
            d = mod_s
        else:
            d = nokori % mod_s
        print(where_li[d-1+a])

main()
import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")


n = int(input())
a = list(map(int, input().split()))
from collections import Counter
c = Counter(a)
ones = sum(v==1 for v in c.values())
ns = [v-1 for v in c.values() if v>1]
ans = ones + len(ns)
ns.sort()
if ns[-1]>sum(ns[:-1]):
    after = ns[-1] - sum(ns[:-1])
    if after%2==1:
        ans -= 1
else:
    after = 1 if sum(ns)%2==1 else 0
    if after==1:
        ans -= 1
print(ans)

### FIXED CODE ###

import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")


n = int(input())
a = list(map(int, input().split()))
from collections import Counter
c = Counter(a)
ones = sum(v==1 for v in c.values())
ns = [v-1 for v in c.values() if v>1]
ans = ones + len(ns)
ns.sort()
if not ns:
    pass
elif ns[-1]>sum(ns[:-1]):
    after = ns[-1] - sum(ns[:-1])
    if after%2==1:
        ans -= 1
else:
    after = 1 if sum(ns)%2==1 else 0
    if after==1:
        ans -= 1
print(ans)
#######################################
p = 2019

l,r = map(int, input().split())
n = r-l+1

if n==1:
  mini = (l*r)%p
elif n<2*p:
  tmps = [(i*j)%p for i in range(l,r) for j in range(i+1,r+1)]
  mini = min(tmps)

else:
  lis = list(range(l,r+1))[:p+1]
  lis = list(set([li%p for li in lis]))
  tmps = [(i*j)%p for i in lis for j in lis]
  mini = min(tmps)
  #mini = 0

print(mini)


### FIXED CODE ###

#######################################
p = 2019

l,r = map(int, input().split())
n = r-l+1

if n<2*p:
  tmps = [(i*j)%p for i in range(l,r) for j in range(i+1,r+1)]
  mini = min(tmps)

else:
  #lis = list(range(l,r+1))[:p+1]
  #lis = list(set([li%p for li in lis]))
  #tmps = [(i*j)%p for i in lis for j in lis]
  #mini = min(tmps)
  mini = 0

print(mini)
a, b, c = map(int, input().split())
ans = 0
if a == b == c and a%2 == 0:
  print(-1)
else:
  while (a%2 or b%2 or c%2) == 0 :
    tmp1 = a
    tmp2 = b
    a = b/2 + c/2
    b = tmp1/2 + c/2
    c = tmp1/2 + tmp2/2
    ans += 1
  print(ans)

### FIXED CODE ###

n = int(input())
k = int(input())
x = list(map(int, input().split()))
ans = 0
for i in range(n):
  if 2*x[i] <= 2*(k-x[i]):
    ans += 2*x[i]
  else:
    ans += 2*(k-x[i])
print(ans)
A,B,C=sorted(map(int.input.split()))
print(A+B+C*10)

### FIXED CODE ###

A,B,C=sorted(map(int,input().split()))
print(A+B+C*10)
import math
import string
import collections
from collections import Counter


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


def nCr(n, r):
    return math.factorial(n)//(math.factorial(n-r)*math.factorial(r))


def has_duplicates2(seq):
    seen = []
    for item in seq:
        if not(item in seen):
            seen.append(item)
    return len(seq) != len(seen)


def divisor(n):
    divisor = []
    for i in range(1, n+1):
        if n % i == 0:
            divisor.append(i)
    return divisor


# coordinates
dx = [-1, -1, -1, 0, 0, 1, 1, 1]
dy = [-1, 0, 1, -1, 1, -1, 0, 1]
h, w = map(int, input().split())
tmp = [None]*h
for i in range(w):
    tmp[i] = input()
# print(tmp)
for i in range(h-1):
    for j in range(w-1):
        if tmp[i][j] == '#':
            if (i != 0 and tmp[i-1][j] == '#')or(i+1 < h and tmp[i+1][j] == '#') or(j != 0 and tmp[i][j-1] == '#')or(j+1 < w and tmp[i][j+1] == '#'):
                continue

            print('No')
            exit()
print('Yes')


### FIXED CODE ###

import math
import string
import collections
from collections import Counter
from collections import deque


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


def nCr(n, r):
    return math.factorial(n)//(math.factorial(n-r)*math.factorial(r))


def has_duplicates2(seq):
    seen = []
    for item in seq:
        if not(item in seen):
            seen.append(item)
    return len(seq) != len(seen)


def divisor(n):
    divisor = []
    for i in range(1, n+1):
        if n % i == 0:
            divisor.append(i)
    return divisor


# coordinates
dx = [-1, -1, -1, 0, 0, 1, 1, 1]
dy = [-1, 0, 1, -1, 1, -1, 0, 1]

H, W = map(int, input().split())
s = [None]*H
for i in range(H):
    s[i] = input()
    # print(s[i])
for i in range(H):
    for j in range(W):
        if s[i][j] == '#':
            #print(i, j)
            if (i != 0 and s[i-1][j] == '#') or(i != H-1 and s[i+1][j] == '#')or(j != 0 and s[i][j-1] == '#') or(j != W-1 and s[i][j+1] == '#'):
                continue
            else:
                print('No')
                exit()
print('Yes')
N=int(input())
D=int(input())
a=2*n+1
b=D//a+1
print(b)

### FIXED CODE ###

[N,D]=[int(i) for i in input().split()]
a=(2*D)+1
b=(N//a)+1

if N%a==0:b-=1
print(b)
n,k=map(int,input().split())
a=list(map(int,input().split())
a.sort()
print(sum(a[:k]))

### FIXED CODE ###

value = input()
if value.isupper():
  print("A")
else:
  print("a")
x = input()
print(x * x * x)


### FIXED CODE ###

x = int(input())

ans = x * x * x

print(ans)
n=int(input())
a=list(map(int,input().split()))

#n=5
#stra="2 2 3 5 5"
#ans=2

#n=9
#stra="1 2 3 4 5 6 7 8 9"
#ans=0

#n=6
#stra="6 5 4 3 2 1"
#ans=18

#n=7
#stra="1 1 1 1 2 3 4"
#ans=6

#a=list(map(int,stra.split()))

for i in range(n):
    a[i]=a[i]-i-1
#print(a)
a.sort()

s=[a[0]]
for i in range(1,n):
    s.append(s[i-1]+a[i])
    
bmin=min(a)-n
bmax=max(a)+n

  
asmin=bmax*n
m0=0
for b in range(bmin,bmax+1):
    m=bisect.bisect(a,b)
    if m<=0:
        asf=-n*b+s[n-1]
    elif m<n:
        asf=(2*m-n)*b+s[n-1]-2*s[m-1]
    elif n<=m:
        asf=n*b-s[n-1]
        
#    print("b",b,"m",m,"asf",asf)
    if asf<asmin:
        asmin=asf

print(asmin)


### FIXED CODE ###

import bisect

a=[]
s=[]
def asff(a,b,s,n):
    m=bisect.bisect(a,b)
    if m<=0:
        asf=-n*b+s[n-1]
    elif m<n:
        asf=(2*m-n)*b+s[n-1]-2*s[m-1]
    elif n<=m:
        asf=n*b-s[n-1]
    return asf

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

#n=5
#stra="2 2 3 5 5"
#ans=2

#n=9
#stra="1 2 3 4 5 6 7 8 9"
#ans=0

#n=6
#stra="6 5 4 3 2 1"
#ans=18

#n=7
#stra="1 1 1 1 2 3 4"
#ans=6

#a=list(map(int,stra.split()))

for i in range(n):
    a[i]=a[i]-i-1
#print(a)
a.sort()

s=[a[0]]
for i in range(1,n):
    s.append(s[i-1]+a[i])
    
bmin=min(a)-n
bmax=max(a)+n

b1=bmin
b5=bmax+1
b2=b1+int((b5-b1)/4)
b3=b1+int((b5-b1)/2)
b4=b1+int((b5-b1)/4*3)
#b2=b1+(b5-b1)//4
#b3=b1+(b5-b1)//4*2
#b4=b1+(b5-b1)//4*3
#print("b1",b1,"b5",b5)
    
asmin=bmax*n
#m0=0
m1=bisect.bisect(a,bmin)


while b1+1<b5:
    c=[]
    c.append([asff(a,b1,s,n),b1])
    c.append([asff(a,b2,s,n),b2])
    c.append([asff(a,b3,s,n),b3])
    c.append([asff(a,b4,s,n),b4])
    c.append([asff(a,b5,s,n),b5])
    c.sort()
    asf=c[0][0]
    d=[]
    d.append(c[0][1])
    d.append(c[1][1])
    d.append(c[2][1])
    d.sort()
    b1=d[0]
    b5=d[2]
    b2=b1+int((b5-b1)/4)
    b3=b1+int((b5-b1)/2)
    b4=b1+int((b5-b1)/4*3)
    
#    print("b1",b1,"b5",b5,"d0",d[0],"asf",asf)
    if asf<asmin:
        asmin=asf

print(asmin)
N,M = map(int,input().split())
a = [0 for i in range(M)]
b = [0 for i in range(M)]
for i in range(M):
    A,B = map(int,input().split())
    a[i] = A
    b[i] = B

ans = 0
while 1:
    if len(a) == 0:
        break
    maxVal = max(a)
    if ans == 0:
        maxVal = maxVal // 2
    maxIdx = a.index(maxVal)

    for j in reversed(range(len(a))):
        if a[j] <= maxVal <= b[j] - 1:
            a.pop(j)
            b.pop(j)

    ans += 1

print(ans)

### FIXED CODE ###

N,M = map(int,input().split())
listAB = [list(map(lambda x:int(x),input().split())) for i in range(M)]
# 要素の2番目でソート
listAB.sort(key=lambda x: x[1])
# 最後に切った橋の位置
last = -1
ans = 0
for a,b in listAB:
    # 切った橋より右側に依頼があるか
    if last <= a:
        ans += 1
        # 切った位置はbの位置
        last = b

print(ans)
import sys
import math
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

A, B = map(int, input().split())
print(int(A * B / math.gcd(A, B)))


### FIXED CODE ###

import sys
import fractions
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

A, B = map(int, input().split())
print(int(A * B / fractions.gcd(A, B)))
counter = 1
while true:
    x = input()
    if x == 0 : 
        break
    print("Case {}: {}".format(counter,x))
    counter = counter + 1



### FIXED CODE ###

ans = []
for i, x in enumerate(open(0).readlines()):
    ans.append("Case %d: %s" % (i+1, x))
open(1,'w').writelines(ans[:-1])
X = int(input())
for key, value in enumerate(rate_sec):
    if X < value:
        print(8-key)
        break

### FIXED CODE ###

X = int(input())
rate_sec = [i*200+600 for i in range(8)]

for key, value in enumerate(rate_sec):
    if X < value:
        print(8-key)
        break
n,k=map(int,input().split())
ans = [i for i in range(1,n+1)]
for i in range(k):
    input()
	a=list(map(int,input().split()))
	for j in a:
      if j in ans:
        ans.remove(j)
print(len(ans))

### FIXED CODE ###

n,k=map(int,input().split())
ans = [i for i in range(1,n+1)]
for i in range(k):
  input()
  a=list(map(int,input().split()))
  for j in a:
    if j in ans:
      ans.remove(j)
print(len(ans))
a,b=int(input())

x=(a+b)//2

print(x)

### FIXED CODE ###

import math

a,b=map(int,input().split())
x=(a+b)/2

print(math.ceil(x))
x = int(input())
if x == 3,5,7
  print("YES")
else:
  print("NO")

### FIXED CODE ###

x = int(input())
if x == 3 or x == 5 or x == 7:
  print("YES")
else:
  print("NO")
a, b = map(int, input().split())
n = min(a, b)
def primes(n):
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False
    return [i for i in range(n + 1) if is_prime[i]]
l = primes(n)
count = 1
for p in l:
    if a % p == 0 and b % p == 0:
        count += 1
print(count)

### FIXED CODE ###

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

def gcd(a, b):
    while b > 0:
        a, b = b, a%b
    return a
n = gcd(a, b)

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

ans = set(prime_factorize(n))
print(len(ans)+1)
n = int(input())
l = list(map(int, input().split()))
ans = 1

if 0 in a:
  print(0)
  exit()

for i in range(n):
  ans*=ans*l[i]
  if ans > 10**18:
      print(-1)
      exit()

print(ans)
  


### FIXED CODE ###

n = int(input())
l = list(map(int, input().split()))
ans = 1

if 0 in l:
  print(0)
  exit()

for i in range(n):
  ans*=l[i]
  if ans > 10**18:
      print(-1)
      exit()

print(ans)
l = map(int, raw_input().split())

A=l[0]
B=l[1]

if A=='H' and B=='H':
    print('H')

elif A=='H'and B=='D':
    print('D')

elif A=='D' and B=='H':
    print('D')
else:
    print('H')


### FIXED CODE ###

l = input().split()
A=l[0]
B=l[1]

if A=='H' and B=='H':
    print('H')

elif A=='H'and B=='D':
    print('D')

elif A=='D' and B=='H':
    print('D')
else:
    print('H')
import copy
S = input()
T = input()
I = []
S1 = []
for k in range(len(S)):
    if S[k] == '?':
        S1.append("a")
    else:
        S1.append(S[k])
for i in range(len(S)-len(T) + 1):
    S_ = copy.deepcopy(S1)
    flag = 1
    for j in range(i, i + len(T)):
        if S[j] != T[j-i] and S[j] != "?":
            flag = 0
            break
        else:
            S_[j] = T[j-i]     
    if flag:
        temp = ''.join(S_)
        I.append(temp)
S_ = S_.sort()
if len(I) > 0:
    print(I[0])
else:
    print("UNRESTORABLE")

### FIXED CODE ###

import copy
import sys
S = input()
T = input()
if len(T) > len(S):
    print("UNRESTORABLE")
    sys.exit()
I = []
S1 = []
for k in range(len(S)):
    if S[k] == '?':
        S1.append("a")
    else:
        S1.append(S[k])
for i in range(len(S)-len(T) + 1):
    S_ = copy.deepcopy(S1)
    flag = 1
    for j in range(i, i + len(T)):
        if S[j] != T[j-i] and S[j] != "?":
            flag = 0
            break
        else:
            S_[j] = T[j-i]     
    if flag:
        temp = ''.join(S_)
        I.append(temp)
S_ = S_.sort()
if len(I) > 0:
    print(I[-1])
else:
    print("UNRESTORABLE")
import numpy as np
def kouho(x, y, h):
    if h:
        return np.abs(np.arange(101) - x)[:, np.newaxis]  + np.abs(np.arange(101) - y) [np.newaxis] + h

n = int(input())
arrs = []
arrs0 = [np.ones((101, 101), dtype=np.int)*1000000000]
for _ in range(n):
  x, y, h = map(int, input().split())
  if h:
    arrs.append(kouho(x, y, h))
  else:
    arr0.append(kouho(x, y, h))
    
arrs = np.array(arrs)
arrs0 = np.array(arrs0)
for i in range(101):
  for j in range(101):
    if np.all(arrs[:,i,j]==arrs[0,i,j]) and (arrs[0,i,j] <= arrs0[:,i,j].min()):
      print(i, j, arrs[0, i, j])
      break

### FIXED CODE ###

def ni(): 
    return int(input())
def li():
    return map(int, input().split())

xyh = [tuple(li()) for _ in range(ni())]
xmax, ymax, hmax = max(xyh, key=lambda _: _[-1])

for x_cent in range(101):
    for y_cent in range(101):
        h_cent = hmax + abs(xmax-x_cent) + abs(ymax-y_cent)
        
        for x, y, h in xyh:
            if h != max(0, h_cent - abs(x-x_cent) - abs(y-y_cent)):
                break
        else:
            print(x_cent, y_cent, h_cent)
N=int(input())
P=list(map(int,input().split()))
def m(n):
    return min(P[:n+1])
A=[]
if m(i)==P[i] for i in range(N):
    A.append(i)
else:
    pass
print(len(A))

### FIXED CODE ###

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

ans = 0
n_min = 0
for i in range(0,n):
    if i == 0:
        ans += 1
        n_min = p[i]
        continue
    if p[i] <= n_min:
        ans += 1
        n_min = p[i]
print(ans)
#!/usr/bin/env python3
import sys

YES = "Yes"  # type: str
NO = "No"  # type: str


def solve(H: int, W: int, s: "List[str]"):

    dx = [-1, 0, 1, 0]
    dy = [0, -1, 0, 1]

    for i in range(H):
        for j in range(W):
            if(s[i][j] == '#'):
                f = False
                for k in range(4):
                    iy = i+dy[k]
                    ix = j+dx[k]
                    if(0 <= iy < H and 0 <= ix < W and s[iy][ix] == '#'):
                        f = True
                if(f == False):
                    print(NO)
                    exit()
                
    print(YES)

    return


# Generated by 1.1.5 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    H = int(next(tokens))  # type: int
    W = int(next(tokens))  # type: int
    s = [next(tokens) for _ in range(W)]  # type: "List[str]"
    solve(H, W, s)

if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/env python3
import sys

YES = "Yes"  # type: str
NO = "No"  # type: str


def solve(H: int, W: int, s: "List[str]"):

    dx = [-1, 0, 1, 0]
    dy = [0, -1, 0, 1]

    for i in range(H):
        for j in range(W):
            if(s[i][j] == '#'):
                f = False
                for k in range(4):
                    iy = i+dy[k]
                    ix = j+dx[k]
                    if(0 <= iy < H and 0 <= ix < W and s[iy][ix] == '#'):
                        f = True
                if(f == False):
                    print(NO)
                    exit()
                
    print(YES)

    return


# Generated by 1.1.5 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    H = int(next(tokens))  # type: int
    W = int(next(tokens))  # type: int
    s = [next(tokens) for _ in range(H)]  # type: "List[str]"
    solve(H, W, s)

if __name__ == '__main__':
    main()
N,M,K = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
booka = 0
bookb = 0
booknum = 0
time = 0
ba=0
bb=0
lim = 0
while True:
    if booka >= N:
        while time<=K and bookb<M:
            bb += 1
            time += B[bookb]
            bookb += 1
        break
    if bookb>=M:
        while time<=K and booka<N:
            ba += 1
            time += A[booka]
            booka += 1
        break
    if A[booka]<B[bookb]:
        if A[booka]+A[booka+1] > B[bookb]+B[bookb+1]:
            time += B[bookb]
            bookb += 1
        else:
            time += A[booka]
            booka += 1
    else:
        if A[booka]+A[booka+1] <= B[bookb]+B[bookb+1]:
            time += A[booka]
            booka += 1
        else:
            time += B[bookb]
            bookb += 1
    if time >K:
        break
    booknum += 1
    while (booka == N-1 or bookb == M-1) and time <= K:
        if A[booka]<B[bookb]:
            time += A[booka]
            booka += 1
            booknum += 1
        else:
            time += B[bookb]
            bookb += 1
            booknum += 1
if time > K and (bb!=0 or ba!=0):
    booknum-=1
booknum += (ba+bb)

print(booknum)


### FIXED CODE ###

def getmax(x,y):
    if x>y:
        return x
    else:
        return y
N,M,K = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))

a,b = [0],[0]
for i in range(N):   #a[i]にはAの本をi冊読んだ時の時間がそれぞれ保存されている．
    a.append(a[i]+A[i])  #計算量を減らすため，a[i]（1冊前までにかかる時間）を用いる
for i in range(M):
    b.append(b[i]+B[i])

ans,j = 0,M
for i in range(N+1):
    if a[i]>K:
        break
    while b[j] > K-a[i]:    #Bの本を読んだ場合の処理はここで実行される．
        j -=1
    ans = max(ans, i+j)
print(ans)
input = int(input())
nums = []
max = 0
total = 0
for x in input:
  nums.append(int(input()))
  if(input > max):
    max = input
for x in range (1,len(nums)):
  total +=x
print(total - max + max/2) 
  

### FIXED CODE ###

N = int(input())
p = []
for _ in range(N):
    p.append(int(input()))
 
pmax = max(p)
ans = int(sum(p)-pmax/2)
print(ans)
from decimal import *
getcontext().prec = 20
n, k = map(int,input().split())
a = list(map(int,input().split()))
inner = Decimal(0)
outer = Decimal(0)
for i in range(0,n):
    for j in range(0,n):
        if a[i] > a[j]:
            outer += 1
            if i < j:
                inner += 1

print((Decimal(((inner) * (k)) + ((outer) * (Decimal(k) * (k-1)) / 2))%(1000000007)

### FIXED CODE ###

from decimal import *
n, k = map(int,input().split())
a = list(map(int,input().split()))
inner = 0
outer = 0
for i in range(0,n):
    for j in range(0,n):
        if a[i] > a[j]:
            outer += 1
            if i < j:
                inner += 1

print((Decimal(((inner) * (k)) + Decimal((outer) * Decimal((k) * (k-1)) / 2))%(1000000007)))
N,K = map(int, input().split())
V = list(map(int, input().split()))

ans = 0
nums = min(N, K)
for i in range(nums+1): # 左端から取り出す回数
    for j in range(nums+1-i): # 右端から取り出す回数
        for k in range(nums+1-i-j): # Dに戻す個数
            L = V[:i]
            R = V[N-j:]
            #print(L, R, i, j, k)
            if L == []: L = [0]
            if R == []: R = [0]
            LR = L + R
            LR.sort()
            cnt = 0
            while cnt < k:
                if LR[cnt] < 0:
                    cnt += 1
                else:
                    break
            ans = max(ans, sum(LR[cnt:]))

print(ans)

### FIXED CODE ###

N,K = map(int, input().split())
V = list(map(int, input().split()))

ans = 0

for i in range(N+1): # 左端から取り出す回数
    for j in range(N+1-i): # 右端から取り出す回数
        L = V[:i]
        if j == 0:
            R = []
        else:
            R = V[-j:]
        LR = L + R
        if len(LR) > K:
            continue
        num_drop = min(len(LR), K-i-j)
        LR.sort()
        total = sum(LR)
        idx = 0
        while idx < num_drop:
            if LR[idx] < 0:
                total -= LR[idx]
                idx += 1
            else:
                break
        ans = max(ans, total)


print(ans)
#coding: utf-8

nums=list(map(int,input().split()))

a=nums[0]
b=nums[1]

if(a>b){
    print("a>b")
}elif(a<b){
    print("a<b")
}else{
    print("a==b")
}

### FIXED CODE ###

#coding: utf-8

nums=list(map(int,input().split()))

a=nums[0]
b=nums[1]

if a>b:
    print("a > b")
elif a<b:
    print("a < b")
else:
    print("a == b")