Harryxun/stf_run huggingface dataset:
n,k = int(input())
f = []
for _ in range(k):
  x = int(input())
  l = list(map(int,input().split()))
  for i in range(len(l)):
    f.append(l[i])
f = set(f)
print(n-len(f))

### FIXED CODE ###

n,k = map(int,input().split())
f = []
for _ in range(k):
  x = int(input())
  l = list(map(int,input().split()))
  for i in range(len(l)):
    f.append(l[i])
f = set(f)
print(n-len(f))
from heapq import heappop, heappush

n, m = map(int, input().split())
a = list(map(int, input().split()))
bc = [tuple(int(x) for x in input().split()) for _ in range(m)]

h = []

for x in a:
    heappush(h, x)

for b, c in bc:
    for _ in range(b):
        temp = heappop(h)
        if temp >= c:
            heappush(h, temp)
            break
        else:
            heappush(h, c)

print(sum(h))

from heapq import heappop, heappush

n, m = map(int, input().split())
a = list(map(int, input().split()))
bc = [tuple(int(x) for x in input().split()) for _ in range(m)]

h = []

for x in a:
    heappush(h, x)

for b, c in bc:
    for _ in range(b):
        temp = heappop(h)
        if temp >= c:
            heappush(h, temp)
            break
        else:
            heappush(h, c)

print(sum(h))



### FIXED CODE ###

from heapq import heappop, heappush

n, m = map(int, input().split())
a = list(map(int, input().split()))
bc = [tuple(int(x) for x in input().split()) for _ in range(m)]

bc.sort(reverse=True)

h = []

for x in a:
    heappush(h, x)

for b, c in bc:
    for _ in range(b):
        temp = heappop(h)
        if temp >= c:
            heappush(h, temp)
            break
        else:
            heappush(h, c)

print(sum(h))
n = int(input())

def func(n, a):
  b = a**2
  if b > n:
    return (a-1)**2
  else:
    c = a+1
    d = func(n, c)
  
  return d

d = func(n, 1)

print(d)

### FIXED CODE ###

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

ab = abs(a - b)
bc = abs(b - c)
ca = abs(c - a)

if(ab <= d and bc <= d or ca <=d):
  print("Yes")
else:
  print("No")
n = int(input)
a = [7, 5, 3]
if n in a:
  print("YES")
else:
  print("NO")

### FIXED CODE ###

n = int(input())
a = [7, 5, 3]
if n in a:
  print("YES")
else:
  print("NO")
N = int(input())
p = [int(i) for i in input().split()]
check = 0
pp = sorted(p)
for i in range(N):
    if p[i] != p[i + 1]:
        check += 1

if check == 2:
    print('YES')
else:
    print('NO')

### FIXED CODE ###

N = int(input())
p = [int(i) for i in input().split()]
check = 0
pp = sorted(p)
for i in range(N):
    if p[i] != pp[i]:
        check += 1

if check == 2 or check == 0:
    print('YES')
else:
    print('NO')
n = int(input())
a = list(map(int, input().split()))

l = [0]*(10**9+10)
for i in range(n):
    l[a[i]] += 1

bool = True
for j in range(len(l)):
    if l[j] > 1:
        bool = False
    else:
        continue
        
if bool:
    print('YES')
else:
    print('NO')

### FIXED CODE ###

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

ans1 = len(set(a))
ans2 = len(a)
if ans1 == ans2:
    print('YES')
else:
    print('NO')
M = 10**9 + 7
a = [1] + [0] * 12
p = 1
for c in reversed(input()):
    r = range(0, p * 10, p) if c == '?' else (p * int(c),)
    if c != '?':
      a = [a[i - p * int(c)] for i in range(13)]
    else:
      a = [sum(a[(i - j) % 13] for j in range(0, p * 10, p)) % M for i in range(13)] 
    p = p * 10 % 13
print(a[5])


### FIXED CODE ###

M = 10**9 + 7
a = [1] + [0] * 12
p = 1
for c in reversed(input()):
    r = range(10) if c == '?' else (int(c),)
    a = [sum(a[(i - p * j) % 13] for j in r) % M for i in range(13)]
    p = p * 10 % 13
print(a[5])
N=int(input())

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

rcnt=0
length=len(A)
def length(n,*A):
    
    for i in range(length):
        if A[i]==A[i+1]:
            cnt+=1
        if cnt==N:
            print(0)
            return

    for i in range(length):
        cnt=0
        for j in range(length):
            if A[i]%A[j]!=0 and A[i]!=A[j]:
                cnt+=1
        if cnt==N-1:
            rcnt+=1
    print(rcnt)
length(*A)

### FIXED CODE ###

#青の人の解答（hir35）

from collections import Counter
n = int(input())
a = list(map(int, input().split()))

#それぞれの数字が何回ずつ出現したかをカウント
c = Counter(a)

#リストpに10＾6+1個のTrueを格納
p = [True] * (10 ** 6 + 1)

#list(set())で重複したものを取り除いてからリストにできる
s = list(set(a))

#sの要素一つ一つを見ていく
for x in s:
    t = x * 2
    #tが10^6以下ならば，p[t]にFalseを代入
    #つまり，x(aに格納されている数)の倍数がfalseに
    while t <= 10 ** 6:
        p[t] = False
        t += x
ans = 0

for x in a:
    #もしその数が一つしかなくて，倍数がないならans+1
    if c[x] == 1 and p[x] == True:
        ans += 1
print(ans)
n = list(int,input())
if n[0] == 7 or n[1] == 7 or n[2] == 7
  print('Yes')
else:
  print('No')

### FIXED CODE ###

n = input()
if '7' in n:
  print('Yes')
else:
  print('No')
def search(X,Y):

 n=len(X)
 m=len(Y)
 p=[i for i in range(m+1)]
 for i in range(n):
  q=list(range(m+1))
  q[0] = i+1
  for j in range(m):
   if X[i]==Y[j]:
    cost=0
   else:
    cost=1
   q[j+1]=min(p[j+1]+1,q[j]+1,p[j]+cost)
  p,q=q,p
 
 return pre[m]


X=input()
Y=input()

print(search(X,Y))



### FIXED CODE ###

def search(X,Y):

 n=len(X)
 m=len(Y)
 p=[i for i in range(m+1)]
 for i in range(n):
  q=list(range(m+1))
  q[0] = i+1
  for j in range(m):
   if X[i]==Y[j]:
    cost=0
   else:
    cost=1
   q[j+1]=min(p[j+1]+1,q[j]+1,p[j]+cost)
  p,q=q,p
 
 return p[m]


X=input()
Y=input()

print(search(X,Y))
if a % 2 == 0:
    b = a
else:
    b = 2*a
print(b)

### FIXED CODE ###

a = int(input())

if a % 2 == 0:
    b = a
else:
    b = 2*a
print(b)
N = int(input())
List = list(map(int,input().split()))

List.sort()

a = List[N/2-1]
b = List[N/2]

print(int(b-a))

### FIXED CODE ###

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

List.sort()

a = List[int(N/2-1)]
b = List[N//2]

print(int(b-a))
N=int(input())
S=input()

A=[0 for i in range(length-max_num)]
length=len(S)
max_num=0
for c in range(len(S)):

    for i in range(1,length-max_num):
        if i+ A[i] < c+A[c]:
            A[i] = A[i-c]
        else:
            j=max(0,c+A[c]-i)
            while i+j<length and S[j]==S[i+j]:
                j+=1
            A[i]=j
            if max_num<A[i] and i>=A[i]:
                max_num = A[i]
print(max_num)

### FIXED CODE ###

N=int(input())
S=input()

# Zアルゴリズムで解く

def z_algorithm(S):
    N=len(S)
    A = [N] + [0]*(N-1)
    
    left=1
    length=0
    
    while left < N:
        
        # prefixが同じ間length加算
        while left + length < N and S[length] == S[left+length]:
            length += 1
        
        # prefixの一致数保存
        A[left] = length
        
        # 一文字一致していなければ戻る
        if length == 0:
            left+=1
            continue
        
        # lengthの分だけleftとindexの間を埋めていく(はみ出ていないとこまで)
        k=1
        while k+left < N and k+A[k]<length:
            A[left+k] = A[k]
            k += 1
            
        left += k
        length -= k
    return A

c=0
max_num=0
for sub in range(len(S)):
    subS = S[sub:]
    A=z_algorithm(subS)
    for i,a in enumerate(A):
        if i>=a and max_num<a:
            max_num=a
print(max_num)
import bisect
n = int(input())
a = list(map(int, input().split()))
a.sort()

index = bisect.bisect_right(a, a[-1]/2)

if abs(a[-1]/2 - a[index]) > abs(a[-1]/2 - a[index+1]) and n > 2:
    index += 1
print(a[-1], a[index])


### FIXED CODE ###

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

maxi = a[-1]
mini = 1000000001
for i in range(n-1):
    if abs(maxi/2 - a[i]) < mini:
        minindex = i
        mini = abs(maxi/2 - a[i])
print(maxi, a[minindex])
a=int(input())
b=int(input())
if(a>b):
  print(2*a-1)
else if(a=b):
  print(2*a)
else:
  print(2*b-1)

### FIXED CODE ###

a,b=map(int, input().split())
if a>b:
  print(2*a-1)
elif a==b:
  print(2*a)
else:
  print(2*b-1)
import numpy as np
from decimal import Decimal

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

A = np.array(a)
a_mul = Decimal(int(np.prod(A)))

if a_mul > Decimal(10**18):
    print(-1
else:
    print(int(a_mul))
    
print(a_mul)

### FIXED CODE ###

N = int(input())
a = list(map(int,input().split()))
inf=10**18
res = 1
for val in a:
    res = res*val
    if res > inf:
        res = -1
        break
if 0 in a:
    res = 0
print(res)
H,M = map(int,input().split())
if H == 1 and M ==1 :
    print(1)
else :
    prnt(int((H*M +1)//2))

### FIXED CODE ###

import math
H,M = map(int,input().split())
if H == 1 or M ==1 :
    print(1)
else :
    print(math.ceil((H*M)/2))
n,k = map(int,input().split())
s = input()
s[k-1] = s.lower(s[k-1])
print(s)

### FIXED CODE ###

n,k = map(int,input().split())
s = list(input())

s[k-1] = s[k-1].lower()
print(''.join(s))
a,b,c,d = map(int, input().split())

if abs(c-a)<=d:
  print('Yes')
  exit()

if abs(b-a)<=d:
  if abs(c-b)<=d:
  print('Yes')
  exit()

print('No')

### FIXED CODE ###

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

if abs(c-a)<=d:
  print('Yes')
  exit()

if abs(b-a)<=d:
  if abs(c-b)<=d:
    print('Yes')
    exit()

print('No')
n = int(input())
arr = list(map(int,input()))
total = 0
for i in range(n):
  total += (1/arr[i])
 print(1/total)
  

### FIXED CODE ###

n = int(input())
arr = list(map(int,input().split()))
total = 0
for i in range(n):
    total += (1/arr[i])
print(1/total)
import copy
n, m = map( int, input().split() )
connect = []

for _ in range( n+1 ):
    connect.append( [ 0 ] * ( n+1 ) )

for _ in range( m ):
    a, b = map( int, input().split() )
    connect[ a ][ b ] = 1
    connect[ b ][ a ] = 1

guide = [ 0 ] * ( n+1 )
path = [ 0, 0 ] + [ m+1 ] * ( n-1 )
unvisited = [ a for a in range( 1, n+1 ) ]

def solve( a, unvisited ): # aに隣接したやつのguideをaにする．またそれのpathをpath[a]+1にする．
    for b in unvisited:
        if connect[a][b] == 1 and path[a] + 1 < path[b]:
            path[b] = path[a] + 1
            guide[b] = a
    next_unvisited = copy.deepcopy( unvisited )
    next_unvisited.remove( a )
    for b in unvisited:
        if connect[a][b] == 1:
            solve( b, next_unvisited )

solve( 1, unvisited )

if 0 not in guide[2:]:
    print( "Yes" )
    for i in range( 2, n+1 ):
        print( guide[i] )
else:
    print( "No" )


### FIXED CODE ###

####以下カンニング####
n, m = map( int, input().split() )
connect = {}

for _ in range( m ):
    a, b = map( int, input().split() )
    try:
        connect[ a ].append( b )
    except KeyError:
        connect[ a ] = [ b ]
    try:
        connect[ b ].append( a )
    except KeyError:
        connect[ b ] = [ a ]

queue = [ 1 ]
guide = [ -1 ] * ( n+1 )
visited = [ False ] * ( n+1 )

while queue:
    x = queue.pop(0)
    for y in connect[ x ]:
        if visited[ y ] == False:
            queue.append( y )
            guide[ y ] = x
            visited[ y ] = True

print( "Yes" )
for x in range( 2, n+1 ):
    print( guide[x] )
a,b = map(int, input().split())
if b>0:
	p = list(map(int, input().split()))
else:
	print(a)
	exit()

n = a
m = a

for i in range(b):
	print(n)
	print(m)
	print("")
	if n in p:	a,b = map(int, input().split())
if b>0:
	p = list(map(int, input().split()))
else:
	print(a)
	exit()

n = a
m = a

for i in range(b):
	if n in p:	
		n = n-1
			
	else:
		if n < 1:
			continue
		print(n)
		exit()

	if m in p:		
		m = m+1
	else:
		print(m)
		exit()


	
		n = n-1
		if n < 1:
			n = 1
	else:
		print(n)
		exit()

	if m in p:		
		m = m+1
	else:
		print(m)
		exit()


	

### FIXED CODE ###

a,b = map(int, input().split())
if b>0:
	p = list(map(int, input().split()))
else:
	print(a)
	exit()

n = a
m = a

for i in range(b+1):
	"""
	print(n)
	print(m)
	print("")
	"""
	if n in p:	
		n = n-1			
	else:

		print(n)
		exit()

	if m in p:		
		m = m+1
	else:
		print(m)
		exit()
s=input()
ans=1
ans_list=[]
n=len(s)


for i in range(0,n):
    if s[i] in {'A','T','C','G',' '}:
        if i==n-1:
            ans+=1
        elif s[i+1] in {'A','T','C','G',' '}:
            ans+=1
    else:
        ans_list.append(ans)
        ans=1

print(ans_list)
if max(ans_list)==1:
    print(0)
else:
    print(max(ans_list))

### FIXED CODE ###

s=input()
ans=0
ans_list=[]
n=len(s)


for i in range(0,n):
    if s[i] not in {'A','T','C','G',' '}:
        ans_list.append(ans)
        ans=0
#        print(str(ans)+'!')
    else:
        ans+=1
        if i == n-1:
           ans_list.append(ans) 
 #       print(str(ans)+'z')

#print(ans_list)
if max(ans_list)==0:
    print(0)
else:
    print(max(ans_list))
import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    N, x = LI()
    a = LI()

    s = [max(a[i] + a[i+1] - x, 0) for i in range(N - 1)]
    
    ans = sum([ss[i] for i in range(len(s)) if i % 2 == 0])
    print(ans)

if __name__ == '__main__':
    resolve()


### FIXED CODE ###

import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    N, x = LI()
    a = LI()

    # 隣り合う2つの和
    s = [a[i] + a[i+1] for i in range(N - 1)]
    # 隣り合う2つの和をx以下にしたもの
    s_after = [min(i, x) for i in s]

    # 隣り合う2つの和をx以下にしたものから元の数列を復元
    a_after = [0] * N
    a_after[0] = min(a[0], s_after[0])
    for i in range(N - 1):
        a_after[i+1] = min(s_after[i] - a_after[i], a[i+1])

    ans = sum(a) - sum(a_after)
    print(ans)

if __name__ == '__main__':
    resolve()
#!python3

from heapq import heappush, heappop, heapify

iim = lambda: map(int, input().rstrip().split())

def resolve():
    H, N = iim()
    AB = [tuple(iim()) for i in range(N)]
    inf = float("inf")
    AB.sort(key=lambda a: (a[0]/a[1], a[0]), reverse=True)

    def memo(f):
        cache = {}
        def wrapper(*a):
            if a in cache:
                return cache[a]
            b = f(*a)
            cache[a] = b

            return b

        return wrapper

    @memo
    def calc(h):
        if h <= 0: return 0

        bi = inf
        for a, b in AB:
            bj = b + calc(h - a)
            if bi > bj:
                bi = bj
        return bi

    print(calc(H))



if __name__ == "__main__":
    resolve()



### FIXED CODE ###

#!python3
import sys
sys.setrecursionlimit(1000000)

from heapq import heappush, heappop, heapify

iim = lambda: map(int, input().rstrip().split())

def resolve():
    H, N = iim()
    AB = [tuple(iim()) for i in range(N)]
    inf = float("inf")
    AB.sort(key=lambda a: (a[0]/a[1], -a[0]), reverse=True)

    def memo(f):
        cache = {}
        def wrapper(*a):
            if a in cache:
                return cache[a]
            b = f(*a)
            cache[a] = b

            return b

        return wrapper

    @memo
    def calc(h):
        if h <= 0: return 0

        bi = inf
        for a, b in AB:
            bj = b + calc(h - a)
            if bi > bj:
                bi = bj
            else:
                break
        return bi

    print(calc(H))



if __name__ == "__main__":
    resolve()
d = dict()
wa = ac = 0
N, M= map(int,input().split())
for i in range(M):
  a, b = input().split()
    if a not in d:
        d[a] = 0
    if d[a] >= 0 and b == "AC":
        ac += 1
        wa += d[a]
        d[a] = -1
    elif d[a] >= 0:
        d[a] += 1
print(ac,wa)

### FIXED CODE ###

d = dict()
wa = ac = 0
N, M= map(int,input().split())
for i in range(M):
  a, b = input().split()
  if a not in d:
    d[a] = 0
  if d[a] >= 0 and b == "AC":
    ac += 1
    wa += d[a]
    d[a] = -1
  elif d[a] >= 0:
    d[a] += 1
print(ac,wa)
n = int(input())
a,b,c = [],[],[]
for i in range(n):
    line = input()
    line = line.strip("\n").split(" ")
    a.append(int(line[0]))
    b.append(int(line[1]))
    c.append(int(line[2]))

def helper(i, prev=None, memo={}):
    if (i,prev) in memo: return memo[(i,prev)]

    if i >= n: return 0

    happ1 = 0 if prev == 'a' else a[i] + helper(i+1, 'a', memo)
    happ2 = 0 if prev == 'b' else b[i] + helper(i+1, 'b', memo)
    happ3 = 0 if prev == 'c' else c[i] + helper(i+1, 'c', memo)

    memo[(i,prev)] = max(happ1, happ2, happ3)
    return memo[(i, prev)]

print(helper(0))

### FIXED CODE ###

n = int(input())
a,b,c = [],[],[]
for i in range(n):
    line = input()
    line = line.strip("\n").split(" ")
    a.append(int(line[0]))
    b.append(int(line[1]))
    c.append(int(line[2]))

def bottomup(a, b, c):
    dp = [[0 for _ in range(3)] for _ in range(n)]
    
    dp[(n-1)] = [a[n-1], b[n-1], c[n-1]]

    for i in range(n-2,-1,-1):
        dp[i][0] = a[i] + max(dp[i+1][1:])
        dp[i][1] = b[i] + max(dp[i+1][0], dp[i+1][2])
        dp[i][2] = c[i] + max(dp[i+1][:2])
    
    return max(dp[0])
    
print(bottomup(a,b,c))
from collections import deque
n=int(input())
v=list(map(int,input().split()))
d1={}
d2={}
l1=[]
l2=[]
for i in range(n):
    num=v[i]
    if i%2==0:
        try:
            d1[num]+=1
        except:
            d1[num]=1
    else:
        try:
            d2[num]+=1
        except:
            d2[num]=1
for i in d1:
    l1.append([d1[i],i])
for i in d2:
    l2.append([d2[i],i])
l1.sort(reverse=True)
l2.sort(reverse=True)
ans=n
if l1[0][1]!=l2[0][1]:
    ans-=(l1[0][0]+l2[0][0])
elif len(l1)==1 and len(l2)==1:
    ans//=2
elif len(l1)==1:
    ans-=l2[1][0]
elif len(l2)==1
    ans-=l1[1][0]
else:
    a=ans-l1[0][0]-l2[1][0]
    b=ans-l1[1][0]-l2[0][0]
    ans=min(a,b)
print(ans)


### FIXED CODE ###

n=int(input())
v=list(map(int,input().split()))
d1={}
d2={}
l1=[]
l2=[]
for i in range(n):
    num=v[i]
    if i%2==0:
        try:
            d1[num]+=1
        except:
            d1[num]=1
    else:
        try:
            d2[num]+=1
        except:
            d2[num]=1
for i in d1:
    l1.append([d1[i],i])
for i in d2:
    l2.append([d2[i],i])
l1.sort(reverse=True)
l2.sort(reverse=True)
ans=n
if l1[0][1]!=l2[0][1]:
    ans-=(l1[0][0]+l2[0][0])
elif len(l1)==1 and len(l2)==1:
    ans//=2
elif len(l1)==1:
    ans-=l2[1][0]
elif len(l2)==1:
    ans-=l1[1][0]
else:
    a=ans-l1[0][0]-l2[1][0]
    b=ans-l1[1][0]-l2[0][0]
    ans=min(a,b)
print(ans)
a,b=map(int,input().split())
if b==1:
    n=1
else:
    for n in range(1,20):
    if n*a-n>b:
        break
print(n)

### FIXED CODE ###

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

for n in range(0,20):
    if n*(a-1)>=b-1:
        break

print(n)
N, K = map(int, input().split())
S = input()

S += "!"
cur_char = S[0]
cur_char_count = 1
smart_S = ""
smart_count = []
for c in S[1:]:
    if cur_char == c:
        cur_char_count += 1
    else:
        smart_S += cur_char
        smart_count.append(cur_char_count)
        cur_char = c
        cur_char_count = 1

l = 0
r = 0
cnt_0 = 0
cur_sum = 0

ans_cand = []

# print("smart_S: ", smart_S)

while r == 0 or l < r:
    # print("l: {}, r: {}".format(l, r))
    while cnt_0 < K and r < len(smart_S) - 1:
        cur_sum += smart_count[r]
        if smart_S[r] == '0':
            cnt_0 += 1
        r += 1
        
    # proceed one more 
    if r < len(smart_S) and smart_S[r] == '1':
        cur_sum += smart_count[r]
        cnt_0 += 1
        r += 1

    ans_cand.append(cur_sum)

    if l < len(smart_S) and smart_S[l] == '0':
        cur_sum -= smart_count[l]
        cnt_0 -= 1
        l += 1

    else:
        if l < len(smart_S):
            cur_sum -= smart_count[l]
            cnt_0 -= 1
            l += 1
        if l < len(smart_S):
            cur_sum -= smart_count[l]
            cnt_0 -= 1
            l += 1


#print("smart_count: ", smart_count)
#print("ans_cand: ", ans_cand)
print(max(ans_cond))


### FIXED CODE ###

N, K = map(int, input().split())
S = input()
new_S = []
count_S = []

cur_c = S[0]
cur_count = 0

new_S.append(cur_c)
for c in S:
    if c == cur_c:
        cur_count += 1
    else:
        new_S.append(c)
        count_S.append(cur_count)
        cur_count = 1
        cur_c = c
count_S.append(cur_count)        

new_count = []
st_ix = 0
if S[0] == '0':
    cur_sum = sum(count_S[:2*K])
    st_ix = 1
    new_count.append(cur_sum)
else:
    cur_sum = sum(count_S[:2*K+1])
    new_count.append(cur_sum)

en_ix = st_ix + 2*K + 1
cur_sum = sum(count_S[st_ix:en_ix])
new_count.append(cur_sum)

while en_ix < len(count_S):
    # shift st_ix
    st_ix = st_ix + 2
    en_ix = en_ix + 2
    if en_ix >= len(count_S):
        new_count.append(sum(count_S[st_ix:]))
    else:
        cur_sum -= (count_S[st_ix-2] + count_S[st_ix-1])
        cur_sum += (count_S[en_ix-2]
                        + count_S[en_ix-1])
    new_count.append(cur_sum)

print(max(new_count))
w=input()
if len(w)%2==1:
   print('No')
else:
   c=0
   import string
   for _ in string.ascii_lowercase:
      if not w.count(_)%2==0:
         c+=1
if c==0:
   print('Yes')
else:
   print('No')

### FIXED CODE ###

w=input()
c=0
if len(w)%2==1:
   print('No')
else:
   import string
   for _ in string.ascii_lowercase:
      if not w.count(_)%2==0:
         c+=1
   if c==0:
      print('Yes')
   else:
      print('No')
n,a,b=map(int, input().split())
tmp = 0
if n%a+b>a:
    tmp = a
else
    tmp = n%a+b
print((n//(a+b))*a+tmp)

### FIXED CODE ###

n,a,b=map(int, input().split())
tmp = n%(a+b)
if tmp>a:
    tmp = a
print((n//(a+b))*a+tmp)
s = input()
s = s.lstrip('AtCoder ')
s = s.rstrip(' Contest ')
# print(s)
print('A' + s[0] + 'C')

### FIXED CODE ###

a, b, c = input().split()
print(a[0] + b[0] + c[0])
def s(x):
    print('',x,end='')
def p(u):
    if u+1:s(u);p(R[u]);p(L(u))
def i(u):
    if u+1:i(R(u));s(u);p(L(u))
def o(u):
    if u+1:o(R(u));o(L(u));s(u)
        
n = int(inpout())
R, L = [0]*n, [0]*n
for _ in range(n):
    a, b, c = map(int, input().split())
    R[a] = b
    L[a] = c
root = (set(range(n))-set(R)-set(L)).pop()
print(f'Preorder{p(r)}')
print(f'Inorder{i(r)}')
print(f'Postorder{o(r)}')


### FIXED CODE ###

def s(x):
    print('',x,end='')
def p(u):
    if u+1:s(u);p(R[u]);p(L[u])
def i(u):
    if u+1:i(R[u]);s(u);i(L[u])
def o(u):
    if u+1:o(R[u]);o(L[u]);s(u)
        
n = int(input())
R, L = [0]*n, [0]*n
for _ in range(n):
    a, b, c = map(int, input().split())
    R[a] = b
    L[a] = c

root = (set(range(n))-set(R)-set(L)).pop()
print('Preorder');p(root)
print('\nInorder');i(root)
print('\nPostorder');o(root)
print()
up_list = []
down_list = []

for _ in range(n):
    txt = input()
    min_comp = 10 ** 6
    compare = 0
    cnt = 0
    for s in txt:
        cnt += 1
        if s == '(':
            compare += 1
        else:
            compare -= 1
            min_comp = min(min_comp, compare)
    if compare > 0:
        up_list.append([compare, min(min_comp, 0)])
    else:
        down_list.append([compare, min(min_comp, 0) - compare])


up_list.sort(key=lambda x: x[1], reverse=True)
down_list.sort(key=lambda x: x[1], reverse=False)
txt = 'No'
c = 0

for t in up_list + down_list:
    if t[1] + c < 0:
        break
    else:
        c += t[0]
else:
    if c == 0:
        txt = 'Yes'

print(txt)

### FIXED CODE ###

def count_scan(s):
    max_min = 0
    compare = 0
    for c in s:
        if c == '(':
            compare += 1
        elif c == ')':
            compare -= 1
            max_min = min(max_min, compare)
    return min(max_min, compare), compare
 
 
def key(lst):
    m, c = lst
    if c > 0:
        return 1, m
    else:
        return -1, c - m
 
 
def main():
    n = int(input())
    lst = [input() for _ in range(n)]
 
    txt = 'No'
    ans = 0
    for max_min, c in sorted([count_scan(s) for s in lst],
                             reverse=True,
                             key=key):
        if max_min + ans < 0:
            break
        ans += c
    else:
        if ans == 0:
            txt = 'Yes'
 
    print(txt)
  
if __name__ == '__main__':
    main()
n=input()
if n%2 == 0:
 print(n)
else:
 print(n*2)

### FIXED CODE ###

n = int(input())
if n % 2 == 0:
  print(n)
else:
  print(n*2)
import sys
input = sys.stdin.readline

list = [map(int, input().split())]
print(sum(list))

### FIXED CODE ###

import sys
input = sys.stdin.readline

print(input().count("1"))