Harryxun/stf_run huggingface dataset:
from collections import Counter
f = open('pokemon', 'r')
names = []
for line in f:
    names.append(line)
max_length = 0
pokemon = ''
for i in range(len(names)):
    p = [names[i]]
    start = names[i][-2]
    shiritori = True
    count = 1
    while shiritori == True:
        shiritori = False
        for j in range(len(names)):
            if i != j and names[j][0] == start and not names[j] in p:
                count += 1
                start = names[j][-2]
                shiritori = True
                p.append(names[j])
                if count > max_length:
                    max_length = count
                    pokemon = names[i]
                break
    print (p)
print (pokemon + str(max_length))

### FIXED CODE ###

num=int(input())
list1=[]
flag=0
j=0

for i in range(num):

    a=input()



    if a in list1:
        flag+=1
    list1.append(a)
    if j>0:
        if list1[i-1][len(list1[i-1])-1]==list1[i][0]:
           pass

        else:
          flag+=2

    j=1

if flag>0:
    print("No")
else:
    print("Yes")
from numba import njit

@njit("i8(i8)")
def solve(n):
    s = [1] * (n+1)
    ans = 1
    for i in range(2,n+1):
        for j in range(i,n+1,i):
            s[j] += 1
        ans += (i * s[i])
	return ans
n = int(input()) 
print(solve(n))


### FIXED CODE ###

from numba import njit
import numpy as np


@njit("i8(i8)")
def solve(n):
    ans = 1
    res = np.ones(n + 1, dtype=np.int64)
    for i in range(2, n + 1):
        for j in range(i, n + 1, i):
            res[j] += 1
        ans += i * res[i]
    return ans


N = int(input())
print(solve(N))
N=long(input())
print(N**3)

### FIXED CODE ###

N=int(input())
print(N**3)
while True:
	x = int(input())
	for i in range(x):
		try:
			li = list(input())
		except:
			break
		li1 = int("".join(sorted(li)))
		li2 = int("".join(sorted(li,reverse=True)))
		print(li2-li1)


### FIXED CODE ###

ti = int(input())
for i in range(ti):
	x = list(input())
	print(int(''.join(sorted(x,reverse=True))) - int(''.join(sorted(x))))
S = input()
if S = "AAA" or "BBB":
  print("No")
else:
  print("Yes")


### FIXED CODE ###

a = input()
if a=="AAA" or a=="BBB":
  print("No")
else:
  print("Yes")
N, M = [int(i) for i in input().split()]
G = [[None for j in range(N)] for i in range(N)]
d = [None for i in range(N)]
for i in range(M):
    a, b, c = [int(i) for i in input().split()]
    a -= 1
    b -= 1
    G[a][b] = c

def update(x, y, is_updated):
    if x < y:
        is_updated = True
        x = y
    return x, is_updated

d[0] = 0
for m in range(M):
    is_updated = False
    for i in range(N):
        for j in range(N):
            if i == j:
                continue
            if d[j] is None:
                if G[i][j] is not None:
                    d[j] = d[i] + G[i][j]
                    is_updated = True
                    continue
            if G[i][j] is not None:
              d[j], is_updated = update(d[j], d[i] + G[i][j], is_updated)
    if not is_updated:
        break
if is_updated:
    print("inf")
else:
    print(d[-1])

### FIXED CODE ###

N, M = [int(i) for i in input().split()]
G_ls = []
d = [-float("inf") for i in range(N)]
for i in range(M):
    a, b, c = [int(i) for i in input().split()]
    a -= 1
    b -= 1
    G_ls.append([a,b,c])

def update(x, y, is_updated):
    if x < y:
        is_updated = True
        x = y
    return x, is_updated
d[0] = 0
G_ls.sort(key=lambda x:x[0])
for i in range(N):
    for j in range(M):
        is_updated = False
        a, b, c = G_ls[j]
        d[b], is_updated = update(d[b], d[a] + c, is_updated)
if is_updated:
    print("inf")
else:
    print(d[-1])
#! -*- coding: utf-8 -*-

tree = dict()
cost = dict()

N = int(input())
for i in range(N - 1):
    a, b, c = map(int, input().split())
    if a in tree:
        tree[a].append(b)
    else:
        tree[a] = []
        tree[a].append(b)
    if b in tree:
        tree[b].append(a)
    else:
        tree[b] = []
        tree[b].append(a)
    cost[(a, b)] = c
    cost[(b, a)] = c
starts = []
ends = []
Q, K = map(int, input().split())
for i in range(Q):
    x, y = map(int, input().split())
    starts.append(x)
    ends.append(y)

depth = [100010 for i in range(N)]

def dps(position, total_cost):
    if depth[position - 1] > total_cost:
        depth[position - 1] = total_cost
    for next_position in tree[position]:
        if depth[next_position - 1] == 100010:
            dps(next_position, depth[position - 1] + cost[(position, next_position)])

depth[K-1] = 0
dps(K, 0)

for start, end in zip(starts, ends):
    print(depth[start - 1] + depth[end - 1])

### FIXED CODE ###

import sys
sys.setrecursionlimit(1000000)

tree = dict()
cost = dict()

N = int(input())
for i in range(N - 1):
    a, b, c = map(int, input().split())
    if a in tree:
        tree[a].append(b)
    else:
        tree[a] = []
        tree[a].append(b)
    if b in tree:
        tree[b].append(a)
    else:
        tree[b] = []
        tree[b].append(a)
    cost[(a, b)] = c
    cost[(b, a)] = c
starts = []
ends = []
Q, K = map(int, input().split())
for i in range(Q):
    x, y = map(int, input().split())
    starts.append(x)
    ends.append(y)

depth = [1000000000000000 for i in range(N)]

def dps(position, total_cost):
    if depth[position - 1] > total_cost:
        depth[position - 1] = total_cost
    for next_position in tree[position]:
        if depth[next_position - 1] == 1000000000000000:
            dps(next_position, depth[position - 1] + cost[(position, next_position)])

depth[K-1] = 0
dps(K, 0)

for start, end in zip(starts, ends):
    print(depth[start - 1] + depth[end - 1])
N,M=map(int,input().split())
import math
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

print(combinations_count(N,2)+combinations_count(M,2))

### FIXED CODE ###

N,M=map(int,input().split())
from operator import mul
from functools import reduce

def combinations_count(n, r):
    r = min(r, n - r)
    numer = reduce(mul, range(n, n - r, -1), 1)
    denom = reduce(mul, range(1, r + 1), 1)
    return numer // denom

if N>=2:
    a=combinations_count(N,2)
else:
    a=0
if M>=2:
    b=combinations_count(M,2)
else:
    b=0
print(a+b)
n = int(input())
s = list()

for a in range(n):
    s.append(input())

t = list()
m = int(input())

for a in range(m):
    t.append(input())

kind = list(set(s))
kind_length = len(kind)

counter = dict()
for a in range(kind_length):
    counter[kind[a]] = 0

for a in range(n):
    counter[s[a]] += 1

for a in range(m):
    if t[a] not in counter:
        continue
    counter[t[a]] -= 1

print(max(counter.values(), 0))


### FIXED CODE ###

n = int(input())
s = list()

for a in range(n):
    s.append(input())

t = list()
m = int(input())

for a in range(m):
    t.append(input())

kind = list(set(s))
kind_length = len(kind)

counter = dict()
for a in range(kind_length):
    counter[kind[a]] = 0

for a in range(n):
    counter[s[a]] += 1

for a in range(m):
    if t[a] not in counter:
        continue
    counter[t[a]] -= 1

print(max(max(counter.values()), 0))
N, M = map(int, input().split())
lst = list(map(int, input().split()))
lst.sort()
lst2 = []
for i in range(1, M):
    lst2.append(lst[i] - lst[i-1])
lst2.sort()
print(sum(lst2[0:(M-N)]))


### FIXED CODE ###

t, x = map(int, input().split())
print(t/x)
n,m,x=map(int,input().split())
a=sum(int(i)<x for i in input().split())
print(min(s,m-s))

### FIXED CODE ###

n,m,x=map(int,input().split())
s=sum(int(i)<x for i in input().split())
print(min(s,m-s))
N = int(input())
a,b,c,d = [0]*N,[0]*N,[0]*N,[0]*N
for i in range(N):
    a[i],b[i] = map(int,input().split())
for i in range(N):
    c[i],d[i] = map(int,input().split())

e = [(0,"")]*2*N
for i in range(N):
    e[a[i]] = (b[i],"R")
    e[c[i]] = (d[i],"B")

ans,p = 0,0
for i in range(2*N):
    n,c = e[i]
    if c == "R":
        p += 1
        if p > 0:
            ans += 1
    else:
        p -= 1

print(ans)

### FIXED CODE ###

N,M = map(int, input().split())
if N==1 and M==1:
    print(1)
elif N<3 and M<3:
    print(0)
elif N==1 or M==1:
    print(max(N-2,M-2))
elif N==2 or M==2:
    print(0)
else:
    print(max(N-2,1)*max(M-2,1))
h, n = input().split(" ")
h = int(h)
n = int(n)
a = [int(input()) for i in range(n) ]
if sum(a) >= h:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

h, n = input().split(" ")
h = int(h)
n = int(n)
a = input().split(" ")
a = [int(x) for x in a]
if sum(a) >= h:
  print('Yes')
else:
  print('No')
cnt_4=0
for i in range(n):
  if a[i]%2!=0:
    cnt_odd+=1
  else:
    cnt_even+=1
    if a[i]%4==0:
      cnt_4+=1
if cnt_even-cnt_4==0:
  if cnt_4+1>=cnt_odd:
    print("Yes")
  else:
    print("No")
else:
  if cnt_4>=cnt_odd:
    print("Yes")
  else:
    print("No")

### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
cnt_odd=0
cnt_even=0
cnt_4=0
for i in range(n):
  if a[i]%2!=0:
    cnt_odd+=1
  else:
    cnt_even+=1
    if a[i]%4==0:
      cnt_4+=1
if cnt_even-cnt_4==0:
  if cnt_4+1>=cnt_odd:
    print("Yes")
  else:
    print("No")
else:
  if cnt_4>=cnt_odd:
    print("Yes")
  else:
    print("No")
print('red' if int(input() < 3200 else input())

### FIXED CODE ###

print('red' if int(input()) < 3200 else input())
r,g,b = input().split()
print('YES 'int(r+g+b)%4==0 else 'NO')

### FIXED CODE ###

r,g,b = input().split()
print('YES 'if int(r+g+b)%4==0 else 'NO')
from collections import Counter

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

c = Counter(a)

ans = 0
for k, v in c.values():
    if k > v:
        ans += v
    else:
        ans += (v-k)

print(ans)

### FIXED CODE ###

import collections

N = int(input())
A = list(map(int, input().split()))

c = collections.Counter(A)

ans = 0
for i in set(A):
    if i > c[i]:
        ans += c[i]
    if i < c[i]:
        ans += (c[i] -i)
print(ans)
#coding:utf-8
s=[int(i) for i in input().split()]
n=[]
for i in range(s[0]):
  n.append(int(input()))
n.sort()
sa=abs(n[0]-n[s[1]]-1)
for i in range(s[1]):
  print(n[1],n[i+s[1]-1])
  if(sa>abs(n[i]-n[i+s[1]-1])):
    sa=abs(n[i]-n[i+s[1]-1])
print(sa)

### FIXED CODE ###

n=int(input())
if(n==25):
  print("Christmas")
elif(n==24):
  print("Christmas Eve")
elif(n==23):
  print("Christmas Eve Eve")
elif(n==22):
  print("Christmas Eve Eve Eve")
s=input()
b=[]
count=0
for i in range(len(s)):
  if s[i] in "ATCG":
    count+=1
  else:
    b.append(count)
    count=0
print(max(b))

### FIXED CODE ###

s=input()
b=[]
count=0
for i in range(len(s)):
  if s[i] in "ATCG":
    count+=1
  else:
    b.append(count)
    count=0
b.append(count)
print(max(b))
N = int(input())
a = list(map(int,input().split()))

data = []
for i in range(N-1):
  if a[i+1]-a[i] == 0:
    continue
  else:
    data.append(a[i+1]-a[i])

#print(data)
ans = 0
i = 0
while i<len(data)-1:
  if (data[i+1] * data[i]) < 0:
    ans += 1
    i += 1
    left = i
  i += 1
else:
  if left == len(data):
    pass
  else:
    ans += 1
  print(ans)

### FIXED CODE ###

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

data = []
for i in range(N-1):
  if a[i+1]-a[i] == 0:
    continue
  else:
    data.append(a[i+1]-a[i])
#print(data)

if len(data) <= 1:
  print(1)
else:
  ans = 0
  left = 0
  i = 0
  while left < len(data)-1:
    if data[left]*data[left+1] < 0: # 極値
      ans += 1
      left += 1
      i = left
    left += 1
  else:
    if i == len(data):
      pass
    else:
      ans += 1
    print(ans)
MOD = 998244353
n = int(input())
a = []
for i in range(n):
    a.append(int(input()))
a.sort(reverse=True)
a_sum = sum(a)
half = int(sum(a) / 2)

dp = [[0] * (a_sum + 1) for _ in range(n+1)]
dp[0][0] = 1
for i, item in enumerate(a):
    ni = i+1
    for j in range(a_sum+1):
        if dp[i][j] != 0:
            dp[ni][j] += (dp[i][j] * 2) % MOD
            dp[ni][j+item] += dp[i][j]
total = 1
for i in range(n):
    total *= 3
    total = total % MOD
ans = total - (sum(dp[n][half:])*3)

if a_sum % 2 == 0:
    dp = [[0] * (n + 1) for _ in range(n+1)]
    dp[0][0] = 1
    for i, item in enumerate(a):
        ni = n+1
        for j in range(n):
            if dp[i][j] != 0:
                dp[ni][j] += dp[i][j] % MOD
                if j+item < n:
                    dp[ni][j+item] += dp[i][j] % MOD
ans += dp[n][half] * 3
ans = ans % MOD
if ans < 0:
    ans += MOD
print(ans)

### FIXED CODE ###

MOD = 998244353
n = int(input())
a = []
for i in range(n):
    a.append(int(input()))
a_sum = sum(a)
half = int(a_sum / 2)

dp = [[0] * (a_sum + 1) for _ in range(n+1)]
dp[0][0] = 1
for i in range(n):
    ni = i+1
    for j in range(a_sum+1):
        if dp[i][j] != 0:
            dp[ni][j] += (dp[i][j] * 2) % MOD
            dp[ni][j+a[i]] += dp[i][j]
ans = pow(3, n, MOD)
for item in dp[n][half:]:
    ans -= item * 3
    ans %= MOD

if a_sum % 2 == 0:
    dp = [[0] * (half + 1) for _ in range(n+1)]
    dp[0][0] = 1
    for i in range(n):
        ni = i+1
        for j in range(half+1):
            dp[ni][j] += dp[i][j] % MOD
            if j+a[i] < half+1:
                dp[ni][j+a[i]] += dp[i][j] % MOD
ans += dp[n][half] * 3
ans %= MOD
if ans < 0:
    ans += MOD
print(ans)
n,m=input().split()
n=int(n)
m=int(m)
s=0
for i in input().split():
  s=s+ int(i)
if s>n:
  print("-1")
else:
  print(n-s)

### FIXED CODE ###

a=int(input())
print(2*3.14*a)
K,S = input().split()
K = int(K)
if len(S) <= K:
    print(S)
else:
    print(S[0:K]+"...")


### FIXED CODE ###

K = input()
S = input()
K = int(K)
if len(S) <= K:
    print(S)
else:
    print(S[0:K]+"...")
def main():
    N = int(input())

    i = 0
    S = []
    while i < N:
        S.append(list(str(input())))
        i += 1

    i = 0
    while i < N - 1:
        sset = set(S[i]) & set(S[i+1])
        i += 2

    ans = []
    for a in sset:
        i = 0
        n = []
        while i < N:
            n.append(S[i].count(a))
            i += 1
        small = min(n)
        ans.append(a * small)

    ans.sort()
    print(''.join(ans))

main()


### FIXED CODE ###

import sys

def main():
    N = int(input())

    i = 0
    S = []
    while i < N:
        S.append(list(str(input())))
        i += 1
    if N == 1:
        ans = sorted(S[0])
        print(''.join(ans))
        sys.exit()

    i = 0
    while i < N - 1:
        sset = set(S[i]) & set(S[i+1])
        i += 2

    ans = []
    for a in sset:
        i = 0
        n = []
        while i < N:
            n.append(S[i].count(a))
            i += 1
        small = min(n)
        ans.append(a * small)

    ans.sort()
    print(''.join(ans))

main()
N=int(input())
lamps=[]
for a in range(N):
    _=int(input())
    lamps.append(_)
lamps.insert(0,"aaa")

PressedButtons=[False]*N

a=1
count=0


while True:
    if PressedButtons[a]==False:
        PressedButtons[a]=True
        count+=1
        a=lamps[a]
        if a==2:
            print(count)
            exit()
    elif PressedButtons[a]==True:
        print("-1")
        exit()
    else:
        print("-1")
        exit()
print("-1")

### FIXED CODE ###

N=int(input())
lamps=[]
for a in range(N):
    _=int(input())
    lamps.append(_)
lamps.insert(0,"aaa")

PressedButtons=[False]*int(N+1)

a=1
count=0

if lamps.count(2)==0:
    print("-1")
    exit()

while PressedButtons[a]==False :
    PressedButtons[a]=True
    count+=1
    a=lamps[a]
    if a==2:
        print(count)
        exit()
print('-1')
class Tree:
    class Node:
        def __init__(self, n):
            self.left = None
            self.right = None
            self.n = n

        def find(self, total):
            if total == self.n:
                return True
            elif total < self.n:
                return (self.right is not None
                        and self.right.find(total))
            else:
                return ((self.left is not None
                        and self.left.find(total-self.n))
                        or
                        (self.right is not None
                         and self.right.find(total)))

        def __str__(self):
            cs = []
            if self.left is not None:
                cs.append(str(self.left))
            if self.right is not None:
                cs.append(str(self.right))

            return "{} -> ({})".format(self.n, ",".join(cs))


    def __init__(self, ns):
        self.top = self.build_nodes(sorted(ns))

    def has_subset(self, total):
        return self.top.find(total)

    def build_nodes(self, ns):
        if len(ns) == 0:
            return
        
        node = self.Node(ns[-1])
        node.left = self.build_nodes(ns[:-1])
        node.right = self.build_nodes(ns[:-1])

        return node


def run():
    _ = int(input())  # flake8: noqa
    ns = [int(i) for i in input().split()]

    tree = Tree(ns)
    _ = int(input())  # flake8: noqa
    
    for q in (int(j) for j in input().split()):
        if tree.has_subset(q):
            print("yes")
        else:
            print("no")


if __name__ == '__main__':
    run()



### FIXED CODE ###

def create_sums(ns):
    if len(ns) == 0:
        return set()

    s = create_sums(ns[1:])
    return {e + ns[0] for e in s} | s | {ns[0]}


def run_set():
    _ = int(input())  # flake8: noqa
    ns = [int(i) for i in input().split()]

    sums = create_sums(ns)
    _ = int(input())  # flake8: noqa

    for q in (int(j) for j in input().split()):
        if q in sums:
            print("yes")
        else:
            print("no")


if __name__ == '__main__':
    run_set()
import sys
sys.setrecursionlimit(10000)

N = int(input())
a = list(map(int, input().split()))
one = a.count(1)
two = a.count(2)
three = a.count(3)
dp = [[[-1 for i in range(three + 10)] for j in range(two + 10)] for k in range(one + 10)]

def rec(i, j, k):
    if dp[i][j][k] >= 0:
        return dp[i][j][k]
    if i == 0 and j == 0 and k == 0:
        return 0.0
    res = 0.0
    if i > 0:
        res += rec(i-1, j, k) * i
    if j > 0:
        res += rec(i+1, j-1, k) * j
    if k > 0:
        res += rec(i, j+1, k-1) * k
    res += N
    res /= i+j+k
    dp[i][j][k] = res
    return res

rec(one, two, three)
print(dp[one][two][three])


### FIXED CODE ###

import sys
from collections import Counter
sys.setrecursionlimit(10000)

N = int(input())
a = list(map(int, input().split()))
dp = [[[-1 for i in range(N+1)] for j in range(N+1)] for k in range(N+1)]

def rec(i, j, k):
    if dp[i][j][k] >= 0:
        return dp[i][j][k]
    if i == 0 and j == 0 and k == 0:
        return 0.0
    res = 0.0
    if i > 0:
        res += rec(i-1, j, k) * i
    if j > 0:
        res += rec(i+1, j-1, k) * j
    if k > 0:
        res += rec(i, j+1, k-1) * k
    res += N
    res *= 1.0/(i+j+k)

    dp[i][j][k] = res
    return res

c = Counter(a)
one, two, three = c[1], c[2], c[3]
print(rec(one, two, three))
a = int(input())

b = []

for i in range(a):
    b.append(int(input()))

b.sort()

c = []

if a % 2 == 0:
  k = a//2
else:
  k = a//2+1

bb = b[0:k]

bbb = b[k:]
j = len(bb)-1
jj = len(bbb)
bbb.reverse()
i = 0
ii = 0
c.append(bb[-1])
bb.pop()
for llll in range(a-1):
    if i != j and ii != jj:
        p = abs(c[-1]-bb[i])
        pp = abs(c[-1]-bbb[ii])
        if max(abs(c[-1]-bb[i]),abs(c[-1]-bbb[ii])) == p:
            c.append(bb[i])
            c.append(bbb[ii])
            i += 1
            ii += 1
            llll += 1
        else:
            c.append(bbb[ii])
            c.append(bb[i])
            ii += 1
            i += 1
            llll += 1
su = 0
for i in range(a-1):
    su += abs(c[i]-c[i+1])
print(su)


### FIXED CODE ###

import sys,bisect as bs,collections as cl,heapq as hq
sys.setrecursionlimit(100000)
mod = 10**9+7
Max = sys.maxsize
def l(): #intのlist
    return list(map(int,input().split()))
def m(): #複数文字
    return map(int,input().split())
def onem(): #Nとかの取得
    return int(input())
def s(x): #圧縮
    a = []
    aa = x[0]
    su = 1
    for i in range(len(x)-1):
        if aa != x[i+1]:
            a.append([aa,su])
            aa = x[i+1]
            su = 1
        else:
            su += 1
    a.append([aa,su])
    return a
def jo(x): #listをスペースごとに分ける
    return " ".join(map(str,x))
def max2(x): #他のときもどうように作成可能
    return max(map(max,x))
def In(x,a): #aがリスト(sorted)
    k = bs.bisect_left(a,x)
    if k != len(a) and a[k] ==  x:
        return True
    else:
        return False

n = onem()
a = []
for i in range(n):
    a.append(onem())
a.sort()
bbb = a[n//2+(n%2):]
bbb.reverse()

bbbb = a[n//2:]

if len(bbb) >= 3:
    bbbb = [bbbb[0]] + bbbb[2:] + [bbbb[1]]


aaa = a[:n//2+(n%2)]
if len(aaa) >= 3:
    aaa = [aaa[-1]] + aaa[:-2] + [aaa[-2]]

aaaa = a[:n//2]

lll = []
llll = []

for i in range(n):
    if i % 2 == 0:
        lll.append(aaa[i//2])
        llll.append(bbbb[i//2])
    else:
        lll.append(bbb[i//2])
        llll.append(aaaa[i//2])
ans = 0
an = 0
for i in range(n):
    if i == 0:
        st = lll[0]
        stt = llll[0]
    else:
        ans += abs(lll[i] - st)
        st = lll[i]
        an += abs(llll[i] - stt)
        stt = llll[i]
print(max(ans,an))
import fractions

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

lcm = N*M // fractions.gcd(N, M)
ans = lcm

X = [""] * lcm

for i in range(N):
    X[i*lcm//N] = S[i]

for i in range(M):

    if X[i*lcm//M] != "":
        if X[i*lcm//M] != T[i]:
            ans = -1
            break
    
print(ans)

### FIXED CODE ###

import fractions

N, M = map(int, input().split())
S = input()
T = input()
gcd = fractions.gcd(N, M)
lcm = N*M // gcd
ans = lcm


for i in range(gcd):
    if S[i*N//gcd] != T[i*M//gcd]:
        ans = -1
        break 
    
print(ans)
def remove01Pair(R):
    for i in range(len(R) - 1):
        #print(i)
        if R[i:i + 2] == '01':
            R = R[:i] + R[i + 2:]
            #print(R)
            return R
    flag[0] = 1
    return R

def remove10Pair(R):
    for i in range(len(R) - 1):
        #print(i)
        if R[i:i + 2] == '10':
            R = R[:i] + R[i + 2:]
            #print(R)
            return R
    flag[0] = 1
    return R

N = input().strip()
#print(N)
length = len(N)
#print(length)
flag = []
flag.append(0)
while flag[0] == 0:
    N = remove01Pair(N)
    #print(N)
    #time.sleep(1)
flag[0] = 0
while flag[0] == 0:
    N = remove10Pair(N)
    #print(N)
    #time.sleep(1)
#print()
#print(len(N))
f.close()
print(length - len(N))


### FIXED CODE ###

N = input().strip()
#print(N)
length = len(N)
#print(length)
totalZeros = 0
totalOnes = 0
for i in N:
    if i == '0':
        totalZeros += 1
    else:
        totalOnes += 1
if totalOnes < totalZeros:
    answer = totalOnes * 2
else:
    answer = totalZeros * 2

print(answer)
import heapq
from collections import deque

X, Y, A, B, C = list(map(int, input().split()))
p = list(map(int, input().split()))
q = list(map(int, input().split()))
r = list(map(int, input().split()))

p.sort()
q.sort()
r.sort()

pq = deque((heapq.merge(p[A - X:], q[B - Y:])))
r = deque(r)

while pq[0] < r[-1]:
  pq.popleft()
  pq.append(r.pop())

print(sum(pq))

### FIXED CODE ###

import heapq
from collections import deque

X, Y, A, B, C = list(map(int, input().split()))
p = list(map(int, input().split()))
q = list(map(int, input().split()))
r = list(map(int, input().split()))

r.sort()

if A < X:
  p += r[-(X - A):]
  r = r[:-(X - A)]
  A = X

if B < Y:
  q += r[-(Y - B):]
  r = r[:-(Y - B)]
  B = Y

p.sort()
q.sort()

pq = deque(heapq.merge(p[A - X:], q[B - Y:]))

while r and pq[0] < r[-1]:
  pq.popleft()
  pq.append(r.pop())

print(sum(pq))
import sys


def main():
    _ = int(input())

    imps = sys.stdin.readlines()

    db = []
    for imp in imps:
        command = imp.split(' ')
        if command[0] == 'insert':
            db.append(command[1])
        else
            if command[1] in db:
                print('yes')
            else:
                print('no')


main()

### FIXED CODE ###

import sys


def main():
    _ = int(input())

    imps = sys.stdin.readlines()

    db = {}
    for imp in imps:
        c, k = imp.split(' ')
        if c == 'insert':
            db[k] = 0
        elif k in db:
            print('yes')
        else:
            print('no')


main()
A,B,C=map(int(input().split()))
p=B//A
if p>=C:
  print(C)
else:
  print(p)

### FIXED CODE ###

A,B,C=map(int,input().split())
p=B//A
if p>=C:
  print(C)
else:
  print(p)