Harryxun/stf_run huggingface dataset:
import sys
sys.setrecursionlimit(10 ** 7)

H, W = map(int, input().split())
A = []
for _ in range(H):
    A.append(input())

from collections import deque
todo = deque()
seen = [[False] * W for _ in range(H)]
route= [[0] * W for _ in range(H)]
for y in range(H):
    for x in range(W):
        if A[y][x] == '#':
            todo.append((x, y))
            seen[y][x] = True


seen = [[False] * W for _ in range(H)]
route= [[0] * W for _ in range(H)]

dx = [1, 0, -1, 0]
dy = [0, 1, 0, -1]
cnt = 0
while todo:
    for _ in range(len(todo)):
        x, y = todo.popleft()
        #print(x, y)
        for i in range(4):
            if 0 <= x + dx[i] < W and 0 <= y + dy[i] < H:
                if seen[y + dy[i]][x + dx[i]] == False:
                    route[y + dy[i]][x + dx[i]] = route[y][x] + 1
                    seen[y + dy[i]][x + dx[i]] = True
                    todo.append((x + dx[i], y + dy[i]))
    # cnt += 1

#print(seen)
#print(route)
M = 0
for y in range(W):
    for x in range(H):
        M = max(M, route[y][x])
print(M)

### FIXED CODE ###

from collections import deque

h,w = map(int,input().split())
matrix = [["a" for _ in range(w+2)]] + [list("a" + input() + "a") for _ in range(h)] + [["a" for _ in range(w+2)]]

matrix_list1 = deque()
cnt = 0

#黒いタイルの位置情報を確認
for i in range(1,h+1):
    for j in range(1,w+1):
        if matrix[i][j] == "#":
            matrix_list1.append([i,j])

#白いタイルが無くなるまで、黒いタイルを増やす
while len(matrix_list1) != 0:     
    for _ in range(len(matrix_list1)):
        x,y = matrix_list1.popleft()
        if matrix[x+1][y] == ".":
            matrix[x+1][y] = "#"
            matrix_list1.append([x+1,y])
        if matrix[x-1][y] == ".":
            matrix[x-1][y] = "#"
            matrix_list1.append([x-1,y])
        if matrix[x][y+1] == ".":
            matrix[x][y+1] = "#"
            matrix_list1.append([x,y+1])
        if matrix[x][y-1] == ".":
            matrix[x][y-1] = "#"
            matrix_list1.append([x,y-1])
    else:
        if len(matrix_list1) > 0:
            cnt += 1
    
print(cnt)
N, P = [int(i) for i in input().strip().split()]
dic={}

for i in range(2,int(P**(1/2))+1):
    num = 0
    while P%i == 0:
        num = num +1
        P = P/i
    dic[i] = num
    
for i in range(dic):
    for j in range(dic):
        if i < j:
            if j%i == 0:
                del dic[j]
                
ans = 1
for i in dic:
    if N == 1:
        ans = P
        break
    elif dic[i] != 0:
        ans = ans*(i**(dic[i]//N))
print(ans)

### FIXED CODE ###

N, P = [int(i) for i in input().strip().split()]
dic={}
ans = 1

if N == 1:
    print(P)
    quit()
elif P == 1:
    print(1)
    quit()
    
for i in range(2,int(P**(1/2))+1):
    num = 0
    while P%i == 0:
        num = num +1
        P = int(P/i)
    dic[i] = num//N
    ans = ans*(i**(dic[i]))

print(ans)
s=input()
i=1
ans=''
 
while i<=len(s):
  if s[i-1]=='A'|s[i-1]=='C'|s[i-1]=='G'|s[i-1]=='T':
    ans=ans+s[i-1]
  i=i+1
 
print (len(ans))

### FIXED CODE ###

s=input()
i=1
n=0
ans=[0]
sta=0

 
while i<=len(s):
  if s[i-1]=='A'or s[i-1]=='C' or s[i-1]=='G' or s[i-1]=='T':
    n=n+1
    sta=1
  elif sta==1:
    ans.append(n)
    n=0

  if i<=len(s)&n==len(s):
    ans.append(n)
  elif n!=0:
      ans.append(n)
    
  i=i+1
  
print(max(ans))
[n,k]=[int(i) for i in input().split()]
a=k
if n==1:
    print(k)
else:
    for i in range(n-1):
        a=a*(k-1)
    print(a)


### FIXED CODE ###

t=[int(i) for i in input().split()]
t.sort()
#print(t)
a=1
for j in range(1,len(t)):
    if t[j-1]<t[j]:
        a=a+1
print(a)
s =int(input())
int h = s/3600
int m = (s/60)%60
int sec = s%60
print(h:m:sec)


### FIXED CODE ###

x = int(input())
h =x/3600
m =(x/60)%60
sec = x%60
str = "%d:%d:%d"%(h,m,sec)
print(str)
def chess(h,w):
    o = ""
    for i in range(h):
        for j in range(w):
            if (i+j)%2: o+="."
            else: o+="#"
        o+="\n
 
while 1:
    h,w=map(int,raw_input().split())
    if h==w==0:break
    chess(h,

### FIXED CODE ###

def chess(h,w):
    o = ""
    for i in range(h):
        for j in range(w):
            if (i+j)%2: o+="."
            else: o+="#"
        o+="\n"
    print o
 
while 1:
    h,w=map(int,raw_input().split())
    if h==w==0:break
    chess(h,w)
print(*sorted(range(1,int(input())+1),key=lambda _:[(s,-int(p))for s,p in input().split()]))

### FIXED CODE ###

n = int(input())
SP = []
for i in range(n):
    s, p = input().split()
    SP.append([s, int(p), i+1])
SP.sort(key=lambda x: (x[0], -x[1]))
for _, _, i in SP:
    print(i)
n = int(input())
a = map(int, input().split())

d=1
m=0
for i in range(n):
  d *= i
  m += i

ans = d/m
print(ans)

### FIXED CODE ###

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

d=1
m=0
for i in a:
  d *= i
for i in a:
  m += d/i

ans = d/m

print(ans)
# -*- coding: utf-8 -*-
import sys

args=sys.argv
A=int(args[1])
B=int(args[2])


if 0 <=A<=100 and 2<=B<=1000:
    if B%2 == 1:
        print("ERROR")
        exit()
    else :
        if A <=5 :
            fare=0
        elif 6<=A<=12 :
            fare=int(B/2)
        else:
            fare=B
else:
    print("ERROR")
    exit()

print(fare)

### FIXED CODE ###

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

if 0 <=A<=100 and 2<=B<=1000:
    if B%2 == 1:
        print("ERROR")
        exit()
    else :
        if A <=5 :
            fare=0
        elif 6<=A<=12 :
            fare=B//2
        else:
            fare=B
else:
    print("ERROR")
    exit()

print(fare)
s = input()
n = s.count('x')
if x > 7:
    print('NO')
else:
    print('YES')

### FIXED CODE ###

s = input()
n = s.count('x')
if n > 7:
    print('NO')
else:
    print('YES')
s=input()
t=input()
letters=[]
count=[]
for i in range(len(s)):
  if s[i] in letters:
    count[letters.index(s[i])].append(i)
  else:
    count.append([i])
    letters.append(s[i])
failflag=0
for i in count:
  r=t[i[0]]
  for j in i:
    if t[j]!=r:
      failflag=1
letters=[]
count=[]
for i in range(len(s)):
  if t[i] in letters:
    count[letters.index(t[i])].append(i)
  else:
    count.append([i])
    letters.append(t[i])
for i in count:
  r=s[i[0]]
  for j in i:
    if s[j]!=r:
      failflag=1
if failflag==0:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

s=input()
letters=[]
count=[]
for i in range(len(s)):
  if s[i] in letters:
    count[letters.index(s[i])]+=1
  else:
    count.append(1)
    letters.append(s[i])
failflag=0
for i in range(len(count)):
  if count[i]%2==1:
    failflag=1
if failflag==0:
  print('Yes')
else:
  print('No')
ｋ = int(input())
a,b = map(int,input().split())
n=0
while True:
    n+=k
    if n>=a and n=<b:
        print('OK')
        break
    if n>b:
        print('NG')
        
        

### FIXED CODE ###

ｋ = int(input())
a,b = map(int,input().split())
n=0
while True:
    n+=k
    if n>=a and n<=b:
        print('OK')
        break
    if n>b:
        print('NG')
        break
from decimal import *

n = int(input())
T = [int(input()) for i in range(n)]

for i in range(n):
    T[i] = Decimal(T[i])

def gcd(x, y):
    while x != 0 and y != 0:
        x, y = max(x, y), min(x, y)
        x %= y
    return max(x, y)

ans = Decimal(1)
for i in range(n):
    ans = Decimal(ans * T[i] / Decimal(gcd(ans, T[i])))
    #ans = int(ans + 0.1)
print(Decimal(ans))

### FIXED CODE ###

from decimal import *

n = int(input())
T = [int(input()) for i in range(n)]

for i in range(n):
    T[i] = Decimal(T[i])

def gcd(x, y):
    while x != 0 and y != 0:
        x, y = max(x, y), min(x, y)
        x %= y
    return max(x, y)

ans = Decimal(1)
for i in range(n):
    if ans % T[i] != 0:
        ans = ans * T[i] / gcd(ans, T[i])
    #ans = int(ans + 0.1)
    #print(ans)
print(int(ans))
l = []
l1 = []
for i in range(5):
  a = int(input())
  l.append((a,a%10))
l.sort(key = lambda x: x[1])

count = 0
for i in range(5):
  if l[i][1] == 0:
    count += l[i][0]
  else:
    c = i
    break
for i in range(4,c-1,-1):
  
  if i == c:
    count += l[i][0]
  else:
    count += l[i][0] + 10-l[i][1]
print(count)

### FIXED CODE ###

l = []
l1 = []
for i in range(5):
  a = int(input())
  l.append((a,a%10))
l.sort(key = lambda x: x[1])

count = 0
for i in range(5):
  if l[i][1] == 0:
    count += l[i][0]
    if i == 4:
      c = 5
  else:
    c = i
    break
for i in range(4,c-1,-1):
  
  if i == c:
    count += l[i][0]
  else:
    count += l[i][0] + 10-l[i][1]
print(count)
X=int(input(),16)
Y=int(input(),16)
if X>Y:
 print(">")
elif X<Y:
 print("<")
else:
 print("=")

### FIXED CODE ###

X,Y=input().split()
if X>Y:
    print(">")
elif X<Y:
    print("<")
else:
    print("=")
x , y, z = map(int,input().split())
print(z + ' ' + x + ' ' + y)

### FIXED CODE ###

x, y, z = map(str,input().split())
print(z + ' ' + x + ' ' + y)
while True:
    m, d = map(int, raw_inpud().split())
    if m == 0 and d == 0:
        break

### FIXED CODE ###

y = [31,29,31,30,31,30,31,31,30,31,30,31]
dow = {0:"Monday", 1:"Tuesday", 2:"Wednesday", 3:"Thursday", 4:"Friday", 5:"Saturday", 6:"Sunday"}

while True:
    m, d = map(int, raw_input().split())
    if m == 0 and d == 0:
        break
    n = 0
    for i in range(m):
        n += y[i]
    n -= (y[m-1]-d+1)
    print dow[(n+3)%7]
INFTY = 1 << 21
WHITE = 0
GRAY = 1
BLACK = 2
d = [INFTY for i in range(n)]
p = [-1 for i in range(n)]
color = [WHITE for i in range(n)]

n = int(input())
M = [list(map(int, input().split())) for i in range(n)]
for i in range(n):
    for j in range(n):
        if (M[i][j] == -1):
            M[i][j] = INFTY

def prim():
    global M, d, p, color
    d[0] = 0
    while(1):
        minv = INFTY
        u = -1
        for i in range(n):
            if (minv > d[i] and color[i] != BLACK):
                u = i
                minv = d[i]
        if (u == -1):
            break
        color[u] = BLACK
        for v in range(n):
            if (color[v] != BLACK and M[u][v] != INFTY):
                if (d[v] > M[u][v]):
                    d[v] = M[u][v]
                    p[v] = u
                    color[v] = GRAY
    
    return sum([M[i][p[i]] for i in range(n) if (p[i] != -1)])

print(prim())

### FIXED CODE ###

INFTY = 1 << 21
WHITE = 0
GRAY = 1
BLACK = 2

n = int(input())
M = [list(map(int, input().split())) for i in range(n)]

d = [INFTY for i in range(n)]
p = [-1 for i in range(n)]
color = [WHITE for i in range(n)]

for i in range(n):
    for j in range(n):
        if (M[i][j] == -1):
            M[i][j] = INFTY

def prim():
    global M, d, p, color
    d[0] = 0
    while(1):
        minv = INFTY
        u = -1
        for i in range(n):
            if (minv > d[i] and color[i] != BLACK):
                u = i
                minv = d[i]
        if (u == -1):
            break
        color[u] = BLACK
        for v in range(n):
            if (color[v] != BLACK and M[u][v] != INFTY):
                if (d[v] > M[u][v]):
                    d[v] = M[u][v]
                    p[v] = u
                    color[v] = GRAY
    
    return sum([M[i][p[i]] for i in range(n) if p[i] != -1])

print(prim())
import heapq
n,m = map(int,input().split())
l = [0]*n
for i in range(n):
  l[i] = list(map(int,input().split()))
l.sort()

L = [[] for i in range(m+1)]
for i in range(n):
  if l[i][0] <= m:
    L[l[i][0]].append(l[i][1])

a = []
ans = 0
for i in range(m):
  key = i+1
  for j in L[key]:
    heapq.heappush(a, -L[i][j])
  if a != []:
    heapq.heapify(a)
    ans += heapq.heappop(a)
print(-ans)

### FIXED CODE ###

from heapq import *
n,m = map(int,input().split())
l = [[] for i in range(m+1)]
for i in range(n):
  a,b = map(int,input().split())
  if a < m+1:
    l[a].append(b)

ans = 0
a = []
for i in range(1,m+1):
  for j in l[i]:
    heappush(a,-j)
  if a:
    ans -= heappop(a)
print(ans)
n = int(input())
a = list(map(int, input().split()))
d = [0]*n
count = 0
for el in a:
    temp = d[el]
    if temp == 0:
        temp = a.count(el)
        d[el] = temp
    count += temp-1
count //= 2
for el in a:
    print(count - d[el] + 1)

### FIXED CODE ###

from collections import Counter
n = int(input())
a = list(map(int, input().split()))
counter = Counter(a)
d = [0]*(n+1)
count = 0
for el, cnt in counter.most_common():
    d[el] = cnt
    count += cnt*(cnt-1)
count //= 2
for el in a:
    print(count - d[el] + 1)
n = int(input())
ts = list(map(int, input(.split())))
su = sum(ts)
m = int(input())
for _ in range(m):
  p, x = list(map(int, input(.split())))
  ans = su - ts[p] + x
  print(ans)

### FIXED CODE ###

n = int(input())
ts = list(map(int, input().split()))
su = sum(ts)
m = int(input())
for _ in range(m):
  p, x = list(map(int, input().split()))
  ans = su - ts[p - 1] + x
  print(ans)
def resolve():
    N, M = map(int, input().split())

    person_group = [0] * (N+1)
    group_counter = 0
    member_counter = {0: 0}

    def _marge_group(a, b):
        for i in range(len(person_group)):
            if person_group[i] == b:
                person_group[i] == a
        member_counter[a] += member_counter.pop(b)

    for _ in range(M):
        A, B = map(int, input().split())
        if person_group[A] == 0 and person_group[B] == 0:
            group_counter += 1
            person_group[A] = group_counter
            person_group[B] = group_counter
            member_counter[group_counter] = 2
        elif person_group[A] != 0 and person_group[B] == 0:
            person_group[B] = person_group[A]
            member_counter[person_group[A]] += 1
        elif person_group[A] == 0 and person_group[B] != 0:
            person_group[A] = person_group[B]
            member_counter[person_group[B]] += 1
        else:
            if person_group[A] == person_group[B]:
                continue
            else:
                _marge_group(person_group[A], person_group[B])
    print(max(member_counter.values()))

if __name__ == "__main__":
    resolve()

### FIXED CODE ###

class UnionFind():
    def __init__(self, n: int):
        """
        n: ノード数
        """
        self.n = n
        """
        d: UnionFind木のデータ構造
            各要素の根要素を格納するリスト
            根要素の場合は, グループの要素数*-1を格納する
        """
        self.d = [-1] * n

    def find(self, x: int) -> int:
        """
        要素xが属するグループの根を返す
        """
        if self.d[x] < 0:
            return x
        else:
            self.d[x] = self.find(self.d[x])
            return self.d[x]

    def unite(self, x: int, y: int) -> bool:
        """
        要素xが属するグループと, 要素yが属するグループを併合する
        """
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return False

        if self.d[x] > self.d[y]:
            x, y = y, x
        self.d[x] += self.d[y]
        self.d[y] = x
        return True

    def same(self, x: int, y: int) -> bool:
        """
        要素x, yが同じグループに属するかどうかを返す
        """
        return self.find(x) == self.find(y)

    def size(self, x: int) -> int:
        """
        要素xが属するグループのサイズ(要素数)を返す
        """
        return -self.d[self.find(x)]

    def members(self, x: int) -> list:
        """
        要素xが属するグループの要素をリストで返す
        """
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def groups(self) -> list:
        """
        すべての根の要素をリストで返す
        """
        return [i for i, x in enumerate(self.d) if x < 0]

    def group_count(self) -> int:
        """
        グループの数を返す
        """
        return len(self.groups())


def resolve():
    N, M = map(int, input().split())

    uf = UnionFind(N)

    for _ in range(M):
        A, B = map(int, input().split())
        uf.unite(A-1, B-1)

    ans = 0
    for i in uf.groups():
        ans = max(ans, uf.size(i))
    print(ans)

if __name__ == "__main__":
    resolve()
N,M = map( int,input().split() )
print(int( N*(N-1)/2 + M*(M-1)/2)

### FIXED CODE ###

N,M = map( int,input().split() )
print(int( N*(N-1)/2 + M*(M-1)/2))
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys

lis = []
lis2 = []

def sum(lis):
  s = 0
  for e in lis:
    s += e
  return s

while True:
  num = input()
  if num == 0:
    break
  else:
    lis = []
    lis2 = []
    for i in range(num):
      n = input()
      if i == 0:
        d = n
      else:
        d = max( d + n , n )
        lis.append(d)    
    print max(lis)

### FIXED CODE ###

#!/usr/bin/env python
# -*- coding: utf-8 -*-

while True:
  num = input()
  if num == 0:
    break
  lis = [0]*num
  for i in range(num):
    n = input()
    if i == 0:
      lis[0] = n
    else:
      lis[i] = max( lis[i-1] + n , n )
  print max(lis)
import sys
input = sys.stdin.readline

def main()
    h,w,m = map(int,input().split())

    h_array = [ 0 for _ in range(h) ]
    w_array = [ 0 for _ in range(w) ]
    ps = set()
    for i in range(m):
        hi,wi = map( lambda x : int(x) - 1 , input().split() )
        h_array[hi] += 1
        w_array[wi] += 1
        ps.add( (hi,wi) )

    h_great = max(h_array)
    w_great = max(w_array)
    h_greats = list()
    w_greats = list()
    for i , hi in enumerate(h_array):
        if hi == h_great:
            h_greats.append(i)
    for i , wi in enumerate(w_array):
        if wi == w_great:
            w_greats.append(i)

    ans = h_great + w_great


    for _h in h_greats:
        for _w in w_greats:
            if (_h,_w) in ps:
                continue
            print(ans)
            exit()

    print(ans-1)

if __name__ == '__main__'
    main()

### FIXED CODE ###

import queue
h,w,m = ( int(x) for x in input().split() )

h_array = [ 0 for i in range(h) ]
w_array = [ 0 for i in range(w) ]
ps = set()
for i in range(m):
    hi,wi = ( int(x)-1 for x in input().split() )
    h_array[hi] += 1
    w_array[wi] += 1
    ps.add( (hi,wi) )
h_great = max(h_array)
w_great = max(w_array)
h_greats = list()
w_greats = list()
for i in range( h ):
    if h_array[i] == h_great:
        h_greats.append(i)
for i in range( w ):
    if w_array[i] == w_great:
        w_greats.append(i)

ans = h_great + w_great - 1

escaper = False

for i in range( len(h_greats) ):
    hi = h_greats[i]
    for j in range( len(w_greats) ):
        wi = w_greats[j]
        if (hi,wi) not in ps:
            ans += 1
            escaper = True
            break
    if escaper:
        break

print(ans)
n = int(input())

for a in range(1, 10):
  for b in range(a, 10):
    if n = a * b:
      print('Yes')
      exit()

print('No')


### FIXED CODE ###

n = int(input())

for a in range(1, 10):
  for b in range(a, 10):
    if n == a * b:
      print('Yes')
      exit()

print('No')
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)
a,b = map(int, input().split())

import math
lcm = (a * b) / math.gcd(a, b)

lcm = int(lcm)

print(lcm)

### FIXED CODE ###

import fractions
A, B = map(int, input().split())
print(A*B//fractions.gcd(A, B))
S = input()
N = len(S)

x = (N-1)/2
y = (N+3)/2


if S[:x] == S[:x].reverse() and S[:y] == S[:y].reverse():
  print('Yes')
else:
  print('No')

### FIXED CODE ###

S = str(input())
N = int(len(S))

x = int((N-1)/2)
y = int((N+3)/2)

a = str(S[:x])
b = str(S[y:N-1])

reverse_S = ''.join(list(reversed(S)))
reverse_a = ''.join(list(reversed(a)))
reverse_b = ''.join(list(reversed(b)))

if str(S) == str(reverse_S) and str(a) == str(reverse_a) and str(b) == str(reverse_b):
  print('Yes')
else:
  print('No')
H, W = map(int, input().split())

# キャンバスを初期化
pixel = [["."] * H for i in range(W)]

# 入力
for h in range(H):
    pixel[h] = list(input())

# 同じ行を2回繰り返して表示する
for h in range(H):
    print("".join(pixel[h]))
    print("".join(pixel[h]))

### FIXED CODE ###

H, W = map(int, input().split())

# 絵を入力
C = [input() for _ in range(H)]
 
# 2回出力
for i in range(H):
    for j in range(2):
        print(C[i])
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()

n, k = na()
s = input()
ct = 0
lll = 1
li = []
for i in range(n-1):
    if s[i] == s[i+1]:
        ct += 1
        lll += 1
    else:
        li.append(lll)
        lll = 1
li.append(lll)
ans = []
"""
print(ct)
print(li[0::2])
print(li[1::2])
"""
for a, b in zip(li[0::2], li[1::2]):
    ans.append(a+b)
ans.sort()
if len(ans) == 1:
    print(ans[0] - 1)
else:
    for i in range(k):
        ct += (ans[-k] - 1)
    print(ct)

### FIXED CODE ###

import copy
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()

n, k = na()
s = input()
ct = 0
for i in range(n-1):
    if s[i] == s[i+1]:
        ct += 1
print(min(ct + 2 * k, n - 1))
S_dash = list(input())
M = len(S_dash)

T = list(input())
N = len(T)

match = [False for _ in range(M)]

last_match = -100
for i in range(M - N + 1):
    for j in range(N):
        if S_dash[i+j] == "?":
            continue
        elif S_dash[i+j] == T[j]:
            continue
        elif S_dash[i+j] != T[j]:
            break
    else:
        match[i] = True
        last_match = i
S = S_dash.copy()

if last_match == -100:
    print("UNRESTORABLE")
else:
    for i in range(N):
        S[last_match+i] = T[i]
    for i in range(M):
        if S[i] == "?":
            S[i] = "a"
    print(s)

### FIXED CODE ###


S_dash = list(input())
M = len(S_dash)

T = list(input())
N = len(T)

match = [False for _ in range(M)]

last_match = -100
for i in range(M - N + 1):
    for j in range(N):
        if S_dash[i+j] == "?":
            continue
        elif S_dash[i+j] == T[j]:
            continue
        elif S_dash[i+j] != T[j]:
            break
    else:
        match[i] = True
        last_match = i
S = S_dash.copy()

if last_match == -100:
    print("UNRESTORABLE")
else:
    for i in range(N):
        S[last_match+i] = T[i]
    for i in range(M):
        if S[i] == "?":
            S[i] = "a"
    print("".join(str(x) for x in (S)))
s = input()
s＿asc = "".join(sorted(s))
    
t = input()
t_dasc = "".join(sorted(t, reverse=True))

if s_asc < t_desc:
	print("Yes")
else:
    print("No")



### FIXED CODE ###

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