peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
N = int(input())
       
if N%2 == 0:
  print(N//2)
else:
  print(N//2 +1)
# Judge status: Accepted
n = int(input())
v = list(map(int, input().split()))
v.sort()
price = v[0]

for i in range(1, n):
  price = (price + v[i]) / 2

print(price)
# Judge status: Wrong Answer
def main():
    N = int(input())
    A = [int(i) for i in input().split()]
    mul4 = len([a for a in A if a % 4 == 0])
    mul2 = len([a for a in A if a % 4 != 0 and a % 2 == 0])
    less = N - 3*mul4
    if less <= 0 or mul2 >= max(less, 2):
        print("Yes")
    else:
        print("No")


if __name__ == '__main__':
    main()
# Judge status: Accepted
l, r = map(int, input().split())
if r - l > 2019:
    print(0)
else:
    ans = 2019
    for i in range(l, r):
        for j in range(i + 1, r + 1):
             ans = min(ans, (i * j) % 2019)
    print(ans)
# Judge status: Accepted
a, b = input().split()

a = int(a)
b = int(b.replace(".", ""))

print((a * b) // 100)
# Judge status: Accepted
x=int(input())

if x==3 or x==5 or x==7:
    print("YES")
else:
    print("NO")
# Judge status: Accepted
import math
def lcm(x,y):
    return(x*y)//math.gcd(x,y)
n,m=map(int,input().split())
l=list(map(int,input().split()))
a=l[0]//2
for i in range(n-1):
    a=lcm(a,l[i+1]//2)
 
ok = True
for i in range(n):
  if (a//(l[i]//2))%2!=1:
    ok=False
    break
ans = 0
if ok:
    ans = ((m//a)+1)//2
print(ans)
# Judge status: Accepted
a, b, c, d = list(map(int, input().split()))
print(max(a * c, b * d, b * c, a * d))
# Judge status: Accepted
s = input()
ans = 0
if s == "RRR":
  ans = 3
if s == "RRS":
  ans = 2
if s == "RSR":
  ans = 1
if s == "RSS":
  ans = 1
if s == "SRR":
  ans = 2
if s == "SRS":
  ans = 1
if s == "SSR":
  ans = 1
if s == "SSS":
  ans = 0
print(ans)
# Judge status: Accepted

A = int(input())
B = int(input())
C = int(input())
X = int(input())
price = 0
ans = 0 

for i in range(A + 1):
    for j in range(B + 1):
        for k in range(C + 1):
            price = i * 500 + j * 100 + k * 50
            if price == X:
                ans += 1

print(ans)
# Judge status: Wrong Answer
p,q = input().split()
q_ = int(q) -1 
n = input()
n.replace(n[q_], n[q_].lower(), 1)
# Judge status: Accepted
import math

N=int(input())

inputs=input().split(" ")
X=[]

mini=100
maxi=0


for i in inputs:
    i=int(i)
    X.append(i)

    if int(i)<mini:
        mini=i

    if int(i)>maxi:
        maxi=i

minpowersum=math.pow(10,9)
for P in range(mini,maxi+1):

    powersum=0
    for j in range(N):
        powersum+=math.pow((X[j]-P),2)

    if powersum<minpowersum:
        minpowersum=powersum


print(int(minpowersum))
# Judge status: Wrong Answer
k=int(input())
s=9
l=[1,2,3,4,5,6,7,8,9]
n=0
while s<10**5+1:
  t=l[n]
  z=int(str(t)[-1])
  l.append(t*10+z-1)
  l.append(t*10+z)
  s+=2
  if z<9:
    l.append(t*10+z+1)
    s+=1
  n+=1
l.sort()
print(l[k-1])
# Judge status: Accepted
N, X, Y = map(int, input().split())
ans = [0]*(N-1)

def cal_dis(i, j):
    return min(j-i, abs(i-X)+abs(j-Y)+1)

for i in range(1, N+1):
    for j in range(i+1, N+1):
        k = cal_dis(i, j)
        ans[k-1] += 1

print('\n'.join(map(str, ans)))
# Judge status: Accepted
num = input().split(' ')
if num == ['5','7','5'] or num == ['7','5','5'] or num == ['5','5','7']:
    print('YES')
else:
    print('NO')
# Judge status: Accepted
s = list(input())
ans = "Yes" if len(set(s)) == 2 else "No"
print(ans)
# Judge status: Accepted
a,b,c,x,y = [int(i) for i in input().split()]
chk = []
if x>y:
  chk.append(a*(x-y)+c*y*2)
  chk.append(c*x*2)
else:
  chk.append(b*(-x+y)+c*x*2)
  chk.append(c*y*2)
chk.append(a*x+b*y)
chk.append(a*x+c*y*2)
chk.append(c*x*2+b*y)
print(min(chk))
# Judge status: Accepted
a = input().split()
if a[0] == a[1]:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
n = int(input())

s = [list(map(str, input().split())) for _ in range(n)]
for row in s:
    row[1] = int(row[1])
ss = sorted(s)
ins = 0
ans = list()
tmp = 0
for i in ss:
    if i[0] == tmp:
        ans.insert(ins,i)
    else:
        ins = len(ans)
        ans.append(i)
        tmp = i[0]
for j in ans:
    print(s.index(j)+1)
# Judge status: Accepted
N = int(input())
A = list(map(int,input().split()))
A.sort()
n = A[-1]

d = n
r = -1
for a in A[:-1]:
    if n%2==0:
        t = abs(a - n//2)
        if t < d:
            d = t
            r = a
    else:
        t = min(abs(a - n//2), abs(a - (n//2+1)))
        if t < d:
            d = t
            r = a
print(n,r)
# Judge status: Wrong Answer
n = int(input())
for i in range(1,n+1):
    ans = 0
    for x in range(50):
        for y in range(50-x):
            for z in range(50-x-y):
                if (x+y+z)**2 -(x*y+y*z+z*x) == i and x>=1 and y>=1 and z>=1:
                    ans += 1
    print(ans)
# Judge status: Accepted
n = int(input())
lengths = list(map(int, input().split()))

if max(lengths) < sum(lengths) - max(lengths):
    print("Yes")
else:
    print("No")
# Judge status: Accepted
import math
a,b,x = map(int,input().split())
if 2 * x >= a ** 2 * b:
    A = a
    B = 2 * ((b - (x / (a ** 2))))
else:
    A = (2 * x) / (a * b)
    B = b
#print(A,B)
rad = math.atan2(B,A)
ans = math.degrees(rad)
print(ans)
# Judge status: Accepted
N = int(input())
print((N // 2) * ((N + 1) // 2))
# Judge status: Accepted
def judge(n, s):
    for x in range(n, -1, -1):
        for y in range(n - x, -1, -1):
            if 10000 * x + 5000 * y + 1000 * (n - x - y) == s:
                return str(x) + " " + str(y) + " " + str(n - x - y)
    return "-1 -1 -1"

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

print(judge(n, s))
# Judge status: Wrong Answer
import numpy as np

N,M=map(int,input().split())
ac=np.array([0]*N)
wa=np.array([0]*N)

for i in range(M):
    a,b=input().split()
    A=int(a)
    if ac[A-1]==0 and b=="WA":
        wa[A-1]+=1
    else :
        ac[A-1]=1

cal=sum(ac)
ans=sum(ac*wa)
# Judge status: Accepted
A, B, K = map(int, input().split())
if 0<=K<=A:print(A-K,B)
elif A<K<=(A+B):print(0,B-K+A)
elif B<K:print(0,0)
# Judge status: Accepted
#!/usr/bin/env python3
# coding=utf-8

import sys

n = int(sys.stdin.readline().strip())

txy = [(0,0,0)]+[tuple(map(int, l.strip().split(" "))) for l in sys.stdin.readlines()]
check_txy = [abs(_x - _xp) + abs(_y - _yp) <= _t - _tp and (_t + _x + _y) % 2 == 0 for (_t, _x, _y), (_tp, _xp, _yp) in zip(txy[1:], txy)]
if all(check_txy):
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
N,M,K = map(int,input().split())

for n in range(N):
  for m in range(M):
    if K == n*N+m*M-n*M:
      print('Yes')
      exit()
print('No')
# Judge status: Accepted
A, B, M = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
b = [int(i) for i in input().split()]

mincost = 10**12
for _ in range(M):
	x, y, c = [int(i) for i in input().split()]
	cost = a[x-1] + b[y-1] - c
	if cost < mincost:
		mincost = cost
nodiscount_cost = min(a) + min(b)
if nodiscount_cost < mincost:
	print(nodiscount_cost)
else:
	print(mincost)
# Judge status: Wrong Answer
N = int(input())
A = list(map(int, input().split()))

import collections
lst=collections.Counter(A).most_common()
lst_larger=[el for el in lst if el[1]>=2]
#print(lst)
#print(lst_larger)
if len(lst_larger) >= 2:
    lst_larger=sorted(lst_larger, key=lambda x:x[0], reverse=True)
    print(lst_larger[0][0]*lst_larger[1][0])
else:
    print(0)
# Judge status: Accepted
N = int(input())
A = list(map(int,input().split()))
MIN = float('inf')
for i in range(-100,101):
    tmp = 0
    for a in A:
        tmp += (a-i)**2
    MIN = min(MIN,tmp)
print(MIN)
# Judge status: Accepted
from sys import stdin

A = stdin.readline().strip()

if A.islower():
  print("a")
else:
  print("A")
# Judge status: Wrong Answer
s= input()
if "AB" in s or "BA" in s:
  print("YES")
else:
  print("NO")
# Judge status: Wrong Answer
n=int(input())
s=""
while n>0:
  if n % 2 == 1:
    s = "1" + s
    n = (n-1)//2*(-1)
  else:
    s="0"+s
    n=n//2*(-1)
print(s)
# Judge status: Accepted
S = input()

if S == 'RRR':
    print(3)
else:
    if S == 'RRS' or S == 'SRR':
        print(2)
    else:
        if S =='SSS':
            print(0)
        else:
            print(1)
# Judge status: Accepted
n,l=map(int,input().split())

ans=0
t=[]

for i in range(n):
  ans+=l+i
  t.append(l+i)

t.sort(key=lambda x:abs(x))
print(ans-t[0])
# Judge status: Accepted
from bisect import bisect_left
n = int(input())
L = list(map(int,input().split()))
L.sort()
ans =0
for i in range(n):
    for j in range(i+1,n):
        bc = L[i]+L[j]
        a = bisect_left(L,bc)
        ans+= a-j-1
print(ans)
# Judge status: Wrong Answer
a, b, c = map(int, input().split())
k = int(input())
while k > 0:
    if c < b:
        c*=2
    elif b < a:
        b*=2
    k-=1
    if c>b>a:
        print("Yes")
        quit()
print("No")
# Judge status: Wrong Answer
N,M = map(int,input().split())
A = []
B = []
for i in range(N):
  A.append(input())
  
for i in range(M):
  B.append(input())
  
ans = "No"

for i in range(N):
  if B[0] in A[i]:
    b = A[i].index(B[0])
    for j in range(i,M):
      if B[j] not in A[j] or A[j].index(B[j]) != b:
        break
    else:
      ans = "Yes"
      
print(ans)
# Judge status: Accepted
n = int(input())
a = []
b = []
for j in range(n):
    l = list(map(int, input().split()))
    a.append(l[0])
    b.append(l[1])
c = 0
for i in range(n-1, -1, -1):
    if (a[i]+c) % b[i] != 0:
        c += (b[i] - (a[i]+c) % b[i])
print(c)
# Judge status: Accepted
def func(a, b, c):
  if (a <= c <= b):
    print("Yes")
  else:
    print("No")
  
s = input().split()
func(int(s[0]), int(s[1]), int(s[2]))
# Judge status: Wrong Answer
n=int(input())
p=list(map(int,input().split()))
a=0
for i in range(1,n-1):
    if (p[i-1]>p[i] and p[i]>p[i+1]) or (p[i+1]>p[i] and p[i]>p[i-1]):
        a+1
print(a)
# Judge status: Accepted
n,k=map(int,input().split())
s=input()
c=s.count
print(n-1-max(c('LR')+c('RL')-k*2,0))
# Judge status: Accepted
s = list(input())
k = int(input())
A = 'abcdefghijklmnopqrstuvwxyz'
Da = {a:i for i,a in enumerate(A)}

c = 0
for i in range(len(s)):
    if s[i]!='a' and 26-Da[s[i]]<=k:
        k -= 26-Da[s[i]]
        s[i] = 'a'
if k:
    s[i] = A[Da[s[i]]+k%26]
print("".join(s))
# Judge status: Accepted
a = list(map(int, input().split()))
for i in range(5):
    if a[i] != i + 1:
        print(i + 1)
        break
# Judge status: Wrong Answer
w,a,b=map(int,input().split())
print(abs(b-a-w))
# Judge status: Accepted
#設定
import sys
input = sys.stdin.buffer.readline

#ライブラリインポート
from collections import defaultdict

con = 10 ** 9 + 7
#入力受け取り
def getlist():
	return list(map(int, input().split()))

#処理内容
def main():
	H, N = getlist()
	A = getlist()
	if sum(A) >= H:
		print("Yes")
	else:
		print("No")
	


if __name__ == '__main__':
	main()
# Judge status: Wrong Answer
n=int(input())
list=[input() for i in range(n)]
lists=[]
for i in list:
  lists.append(''.join(sorted(i)))
  
print(len(lists)-len(set(lists)))
# Judge status: Wrong Answer
import sys
X,Y = map(int,input().split())
if(X == 1 and Y == 1):
    print(0)
    sys.exit()
elif(Y == 1):
    print(int(X/2))
    sys.exit()
elif(X == 0 and Y ==2):
    print(1)
    sys.exit()
print(int((X * (X-1))/2 + Y))
# Judge status: Accepted
n,k = map(int,input().split())
r,s,p = map(int,input().split())
t = input()
ans = 0
hand = [-1]*n
mk = -1
for i in range(n):
    if i>=k:
        mk = hand[i-k]
    if t[i] =="r" and mk!=2:
        ans+=p
        hand[i] =2
    if t[i] =="s" and mk!=0:
        ans+=r
        hand[i] =0
    if t[i] =="p" and mk!=1:
        ans+=s
        hand[i] =1
print(ans)
# Judge status: Accepted
N, A, B = map(int, input().split())
min_num = A*(N-1) + B
max_num = B*(N-1) + A

if max_num - min_num + 1 >= 0:
    print(max_num - min_num + 1)
else:
    print(0)
# Judge status: Wrong Answer
def c(inp):
	if inp.isupper():
		return "A"
	return "B"
# Judge status: Accepted
h, w = map(int,input().split())

if h == 1 or w == 1:
    count = 1
elif h%2 == 0:
    count = ((w+1)//2 + w//2)*(h//2)
else:
    count = ((w+1)//2 + w//2)*(h//2) + (w+1)//2

print(count)
# Judge status: Wrong Answer
s = input()
print('Yes' if 'a'and'b'and'c' in s else 'No')
# Judge status: Accepted
def solve():
    A, B, K = map(int, input().split())
    for i in range(A, min(A+K, B+1)):
        print(i)
    for j in range(max(A+K, B-K+1), B+1):
        print(j)


if __name__ == "__main__":
    solve()
# Judge status: Accepted
N,*W=open(0)

ans='Yes'
i=0
while i+1<int(N):
    if W[i][-2]!=W[i+1][0]:
        ans='No'
    i+=1
print([ans,'No'][int(N)>len(set(W))])
# Judge status: Accepted
n,w = map(int,input().split())
v = [list(map(int,input().split())) for _ in range(n)]
dp = [[0]*(w+1) for _ in range(n+1)]
for i in range(1,n+1):
  for j in range(w+1):
    if j < v[i-1][0]:
      dp[i][j] = dp[i-1][j]
    else:
      dp[i][j] = max(dp[i-1][j],dp[i-1][j-v[i-1][0]]+v[i-1][1])
print(dp[n][w])
# Judge status: Accepted
import re
S = input()
print('AC' if S.startswith('A') and (S[2:-1]).count('C') == 1 and len(re.findall('[A-Z]', S)) == 2 else 'WA')
# Judge status: Accepted
def get_ints():
    return map(int, input().split())

n, m = get_ints()
print('Yes' if n == m else 'No')
# Judge status: Wrong Answer
s = int(input())

if s > 999:
  print('ABD{:03d}'.format(s-999))
else:
  print('ABC{:03d}'.format(s))
# Judge status: Accepted
# coding: utf-8
# Your code here!
import sys
readline = sys.stdin.readline
read = sys.stdin.read


s = input()

MOD = 2019
d = [0]*MOD
d[0] = 1
r = 0
t = 1
for i in reversed(s):
    r += int(i)*t
    r %= MOD
    t *= 10
    t %= MOD
    d[r] += 1
    
print(sum(i*(i-1)//2 for i in d))
# Judge status: Wrong Answer
N = int(input())
d = list(map(int, input().split()))

D = sorted(d)
print(D)
cn = 0
for i in range(10**5):
    if i >= D[N//2 - 1] and i <= D[N//2]:
        cn = cn + 1

    
print(cn - 1)
# Judge status: Accepted
if __name__ == '__main__':
    n = int(input())
    lst = list(map(int, input().split()))

    ans = (50*101)*(50*101)
    for i in range(-100,101):
        mn = 0
        for c in lst:
            mn += (i-c)*(i-c)
        ans = min(ans,mn)

    print(ans)
# Judge status: Wrong Answer
a, b, k = [int(a) for a in input().split()]
print(a - k, b) if a >= k else print(0, b - (a - k)) if a + b - k > 0 else print(0, 0)
# Judge status: Accepted
s=input()
s=s[:-1]
def Evenstring(str):
    if len(str)%2==0 and str[:len(str)//2]==str[len(str)//2:]:
        return True
    else:
        return False

while True:
    if Evenstring(s)==True:
        print(len(s))
        break
    else:
        s=s[:-1]
        #末尾の一文字を削除
# Judge status: Wrong Answer
import bisect

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

l.sort()
a = sorted(list(set(l)))
ans = 0

for b in range(1,n - 1):
    for c in range(b + 1,n):
        left = bisect.bisect_left(l,l[c] - l[b] + 1)
        right = bisect.bisect_right(l,l[b])
        ans+=max(0,right - left - 1)

print(ans)
# Judge status: Accepted
A, B = input().split()

s = int(A) + int(B)
if s % 2 == 0:
    print(round(s / 2))
else:
    print('IMPOSSIBLE')
# Judge status: Wrong Answer
import sys

input = sys.stdin.readline

def main():
    ans = 0
    n = int(input())
    d = list(map(int, input().split()))
    d.sort()
    g = d[n//2]
    ans += g - d[n//2-1] + 1
    print(ans)

if __name__ == '__main__':
    main()
# Judge status: Accepted
n = int(input())

def f(lst):
  res = 0
  ex = 0
  for a in lst:
    ex += a
    res += ex//2
    ex %= 2
  return res

A = []
ans = 0
for _ in range(n):
  a = int(input())
  if a%2:
    ans += a//2
    a = 1
  else:
    if a>2:
      ans += a//2-1
      a = 2

  if a!= 0:
    A.append(a)
  elif A:
    ans += max(f(A), f(A[::-1]))
    A = []
  else:
    continue
else:
  ans += max(f(A), f(A[::-1]))
print(ans)
# Judge status: Accepted
S = input()
print(S+'es' if S[-1]=='s' else S+'s')
# Judge status: Accepted
n,a,b = map(int,input().split())
s = list(input())
finalists = a + b
rank_b = 0

for i in range(n):
	if s[i] == "a":
		if finalists > 0:
			print("Yes") 
			finalists -= 1
		else:
			print("No")
	elif s[i] == "b":
		rank_b += 1
		if finalists > 0 and rank_b <= b:
			print("Yes") 
			finalists -= 1
		else:
			print("No")
	else:
		print("No")
# Judge status: Accepted
# -*- coding: utf-8 -*-


def main():
    n = int(input())
    ans = 0

    if n % 2 == 1:
        print(ans)
    else:
        division = 10

        while division <= n:
            ans += n // division

            division *= 5

        print(ans)


if __name__ == '__main__':
    main()
# Judge status: Accepted
sx,sy,gx,gy = list(map(int,input().split()))
dx,dy=gx-sx,gy-sy
out = []
out.append("R"*dx)
out.append("U"*dy)
out.append("L"*dx)
out.append("D"*dy)
out.append("D")
out.append("R"*(dx+1))
out.append("U"*(dy+1))
out.append("L")
out.append("U")
out.append("L"*(dx+1))
out.append("D"*(dy+1))
out.append("R")
print("".join(out))
# Judge status: Accepted
print(sum(i for i in range(1,int(input())+1)))
# Judge status: Wrong Answer
A, B = map(int, input().split())
if (A-B)%2 == 0:
    print(A+abs(A-B)//2)
else:
    print("IMPOSSIBLE")
# Judge status: Accepted
from fractions import gcd
a, b, c, d = map(int, input().split())
e = b//c - (a-1)//c
f = b//d - (a-1)//d
def lcm(x, y):
	return (x * y) // gcd(x, y)
g = lcm(c, d)
h = b//g - (a-1)//g

print (b-a+1 -(e+f-h))
# Judge status: Accepted
#!/usr/bin/env python3

import sys
from math import factorial
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)


N = int(input())

if N % 2:
    print(0)
    sys.exit()


div = 10
count = 0
while N // div:
    count += N // div
    div *= 5


print(count)
# Judge status: Wrong Answer
N=int(input())
ABC=[]
for i in range(N):
	ABC+=[[int(i) for i in input().split()]]
DP=[[0,0,0] for i in range(N)]
for i in range(N):
	for j in range(3):
		DP[i][j]=ABC[i][j]+max(DP[i-1][(j+1)%3],DP[i-1][(j+2)%3])
print(max(DP[-1]))
# Judge status: Accepted
import sys
input = sys.stdin.readline
N = int(input())
xl = []
for i in range(N):
    x, l = [int(i) for i in input().split()]
    xl.append((x, l, x+l))
xl.sort(key=lambda x: x[2])
n = xl[0][2]
ans = 1
for x, l, s in xl[1:]:
    if x-l >= n:
        ans += 1
        n = s
print(ans)
# Judge status: Accepted
s,w = map(int, input().split())
if s <= w:
    print("unsafe")
else:
    print("safe")
# Judge status: Wrong Answer
A, B, T = map(int, input().split())

print((T+0.5)//A*B)
# Judge status: Wrong Answer
n = int(input())
p = list(map(int,input().split()))
m = list(range(1,n+1))
count = 0
for i in range(n):
    if p[i] != m[i]:
        count += 1
if count == 0 or count == 2:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
x = int(input())

div = x//500
rem = x-div*500
res = div*1000 + (rem//5)*5
# Judge status: Accepted
from decimal import *
from math import floor
X = int(input())

year = 0
yen = Decimal(100)
while not (yen >= X):
    #print(X)
    yen += floor(yen*Decimal("0.01"))
    year += 1

print(year)
# Judge status: Wrong Answer
a=[input() for i in range(2)]
P=a[0]
S=a[1]
count=0
for t in range(0,len(P)-1):
  if P[t] is S[t]:
    count=count+1
#    else:
#      count=count
print(int(count))
# Judge status: Accepted
n,l=map(int,input().split())
s=sorted([input() for i in range(n)])
print(*s,sep="")
# Judge status: Wrong Answer
a,b=(int(x) for x in input().split())
#print(a)
#print(b)

am=int(100/8*a)
al=int(100/8*(a+1))
if ((a+1)%4)==0:
       al=al-1

bm=int(10*b)
bl=int(10*(b+1))-1

#print (am,al)
#print (bm,bl)
for ia in range(am,al):
       for ib in range(bm,bl):
       		if ia==ib:
       			print (ia)
       			exit()
else:
  print(-1)
# Judge status: Accepted
n=int(input())
a,b,c=[list(map(int,input().split())) for _ in range(3)]
x=sum(b)
for i in range(n-1):
    if a[i]+1==a[i+1]:
        x+=c[a[i]-1]
print(x)
# Judge status: Wrong Answer
from math import floor
X = int(input())
deposit, year = 100, 0
while deposit < X:
  year += 1
  deposit = floor(deposit * 1.01)
print(year)
# Judge status: Accepted
l = [list(map(int, input().split())) for i in range(2)]
if l[0][0] < sum(l[1]):
  print(-1)
else:
  print(l[0][0] - sum(l[1]))
# Judge status: Accepted
a, b = map(int, input().split())
print((a + b + 1) //2)
# Judge status: Accepted
[s,w] = [int(i) for i in input().split()]
if s <= w:
    print("unsafe")
else:
    print("safe")
# Judge status: Wrong Answer
# -*- coding: utf-8 -*-

s = input()
before = '0'
for i in s:
    if i == before:
        print('Bad')
        exit(0)

    before = i

print('Good')
# Judge status: Accepted
T=str(input())
ans=""
pre=False
for i in range(len(T)):
    if T[i]=="D":
        ans+=T[i]
        pre=False
    elif T[i]=="P":
        ans+=T[i]
        pre=True
    else:
        if pre==True:
            ans+="D"
            pre=False
        else:
            ans+="D"
print(ans)
# Judge status: Accepted
K,A,B = map(int,input().split())
if A+2 >= B:
    print(1+K)
else:
    beatC,m = divmod((K - (A-1)),2)
    print(beatC*(B-A)+(K - 2 * beatC)+1)
# Judge status: Wrong Answer
n = int(input())
ans = []
cnt = 0
for i in range(1, n+1):
    if n > cnt:
        ans.append(i)
        cnt += i
    else:
        if cnt - n in ans:
            ans.remove(cnt - n)
            break
for i in ans:
    print(i)
# Judge status: Wrong Answer
N,W = map(int,input().split())
V = sorted([[int(x) for x in input().split()] for _ in range(N)])
dp = [0]*(W+1)
s = 0
for w,v in V:
    s += w
    for j in range(w-1,min(W,s)):
        if dp[j-w] + v > dp[j]:
            dp[j] = dp[j-w] + v
print(max(dp))
# Judge status: Accepted
N, K = map(int, input().split())
num = [0]*(10**5+1)
for i in range(N):
    a, b= map(int, input().split())
    num[a] += b
for i in range(1, 10**5+1):
    if K <= num[i]:
        print(i)
        exit()
    K -= num[i]
# Judge status: Accepted
N, M = map(int, input().split())
A = [[int(x) for x in input().split()] for y in range(N)]
ans = set(int(z) for z in range(1, 31))
for i in range(N):
    A[i].pop(0)
    ans = ans & set(A[i])
print(len(ans))
# Judge status: Accepted
import math
K = int(input())
rst = 0
for i in range(1, K + 1):
    for j in range(1, K + 1):
        tmp = math.gcd(i, j)
        for k in range(1, K + 1):
            rst += math.gcd(tmp, k)
print(rst)
# Judge status: Wrong Answer
S = input()

ans = 1000
for i in range(len(S)-2):
    print(abs(int(S[i:i+3])- 753))
    t = abs(int(S[i:i+3])- 753)
    if t < ans:
        ans = t
print(ans)
# Judge status: Wrong Answer
x=int()
y=int()
sum=x+y
transform=(sum-x)*(sum-y)
print(transform)
# Judge status: Accepted
A = int(input())

print(sum(list(range(1,A+1))))
# Judge status: Accepted
if sum(list(map(int,input().split()))) >= 22:
    print("bust")
else:
    print("win")
# Judge status: Wrong Answer
#C
n = int(input())

f = [0 for _ in range(10**5)]

for i in range(1,50):
    for j in range(1,50):
        for k in range(1,50):
            f[i**2 + j**2 + k**2 + i*j + j*k + k*i] += 1

for l in range(n):
    print(f[l+1])
# Judge status: Wrong Answer
n = int(input())
p = list(map(int, input().split()))
c = 0

for i in range(n):
    if p[i] != i + 1:
        c += 1

if c <= 2:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
N = int(input())
s = input().strip()
t = input().strip()
flag = 0
for k in range(N,0,-1):
    if s[N-k:]==t[:k]:
        flag = k
        break
print(2*N-flag)
# Judge status: Accepted
N = int(input())
a = list(map(int, input().split()))
up = -1
ans = 1
for i in range(1, N):
    if up == 0 and a[i] - a[i-1] > 0:
        up = -1
        ans += 1
    elif up == 1 and a[i] - a[i-1] < 0:
        up = -1
        ans += 1
    elif up == -1 and a[i] - a[i-1] > 0:
        up = 1
    elif up == -1 and a[i] - a[i-1] < 0:
        up = 0
print(ans)
# Judge status: Wrong Answer
n = int(input())
xl = [list(map(int, input().split())) for _ in range(n)]
xl.sort(key=lambda x: x[0])
prev = 0
cnt = 0
for i in range(1, n):
    if xl[prev][0]+xl[prev][1] > xl[i][0] - xl[i][1]:
        cnt += 1
    else:
        prev = 1
print(n-cnt)
# Judge status: Accepted
n=int(input())
A=[0]*n
S=input()

for i in range(n):
    if S[i]=="E":
        A[i]=1
E=sum(A)
e=E

ans=n+10
for i in range(n):
    if A[i]==1:
        e-=1
        ans=min(e+i-(E-e-1),ans)
    else:
        ans=min(e+i-(E-e),ans)
print(ans)