Harryxun/stf_run huggingface dataset:
N = input()
A = input()


A_list = []
for i in range(0, len(A), 1):
    A_list.append(int(A[i: i + 1]))


A_list_int = list(map(int, A_list))

max = max(A_list_int)
min = min(A_list_int)

print(max - min)

### FIXED CODE ###

N = input()
A_list = input().split()

A_list_int = list(map(int, A_list))

max = max(A_list_int)
min = min(A_list_int)

print(max - min)
a=0
b=0
lists=[]
n=int(input())
if n>=7and n!=19999:
    lists2=[2*j for j in range(1,15001)]
    lists3 =[3+6*k for k in range(0,5000)]
    for q in range(1,2501):
        if (n-2*q)%3==0 and 1<=(n-2*q)<=15000:
            a=(n-2*q)
            b=q
            print(a,2*b)
    lists=lists2[:a]+lists3[:2*b]
    print(*lists)
elif n==3:
    lists=[2,5,63]
    print(*lists)
elif n==4:
    lists=[2 ,5 ,20, 63]
    print(*lists)  
elif n==5:
    lists=[2,4,6,3,9]
    print(*lists)
elif n==6:
    lists=[2,5,20,63,70,140]
    print(*lists)
elif n==19999:
    lists=lists2[:14999]+lists3[:4988]
    lists.append(229)
    print(*lists)

### FIXED CODE ###

a=0
b=0
lists=[]
n=int(input())
lists2=[2*j for j in range(1,15001)]
lists3 =[3+6*k for k in range(0,5000)]
for q in range(1,2501):
    if (n-2*q)%3==0 and 1<=(n-2*q)<=15000:
        a=(n-2*q)
        b=q
if n>=7and n!=19999:
    lists=lists2[:a]+lists3[:2*b]
    print(*lists)
elif n==3:
    lists=[2,5,63]
    print(*lists)
elif n==4:
    lists=[2 ,5 ,20, 63]
    print(*lists)  
elif n==5:
    lists=[2,4,6,3,9]
    print(*lists)
elif n==6:
    lists=[2,5,20,63,70,140]
    print(*lists)
elif n==19999:
    lists=lists2[:14985]
    addlist2=[]
    count=0
    for i in lists3:
        if i%5!=0:
            addlist2.append(i)
            count+=1
        if count==3040:
            break
    addlist3=[]
    counter=0
    for i in range(5,30001,5):
        if i%2!=0 and i%3!=0:
            addlist3.append(i)
            counter+=1
        if counter==1974:
            break
    lists=lists+addlist2+addlist3
    print(*lists)
[s, n] = [int(x) for x in input().split()]

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

### FIXED CODE ###

[a, b] = [int(_) for _ in input().split()]

if a < b:
    print('a < b')
elif a > b:
    print('a > b')
else:
    print('a == b')
a = input_a()
b = input_b()

print a * b 
print 2 * (a + b)

### FIXED CODE ###

a, b = map(int, raw_input(). split())
print a * b, 2 * (a + b)
n=int(input())
while n!=0:
    sum_list=[0]
    for i in range(n):
        sum_list.append(sum_list[-1]+int(input()))

    if max(sum_list)==0:
        sum_list.pop(0)
        print(max(sum_list))
    maximum=0
    for i in range(n):
        for j in range(i,n+1):
            maximum=max(sum_list[j]-sum_list[i],maximum)

    print(maximum)
    n=int(input())

### FIXED CODE ###

import sys
while True:
    n=int(input())
    if n==0:
        sys.exit()

    a=[0]
    for i in range(n):
        a.append(int(input())+a[-1])

    maximum=0
    for i in range(n+1):
        for j in range(i):
            maximum=max(maximum,a[i]-a[j])



    if maximum==0:
        b=[a[i+1]-a[i] for i in range(n)]
        maximum=max(b)

    print(maximum)
N, K, C = map(int, input().split())
S = str(input())

#前から貪欲に
x = 0
L = [-1] * N
p = 0
while x < N:
  if S[x] == "o":
    L[p] = x
    p += 1
    x += C + 1
  else:
    x += 1

#後ろから貪欲に    
y = N - 1
R = [-1] * N
q = 0
while y > -1:
  if S[y] == "o":
    R[q] = y
    q += 1
    y -= C + 1
  else:
    y -= 1
    
#print(L, R)    
L_1 = L.index(-1)
L = L[:L_1]
R = R[:L_1]
N = len(L)

#LとRの被っている数に1足したものを出力
for i in range(N):
  if L[i] == R[N - i - 1]:
    print(L[i] + 1)




    
  
  


### FIXED CODE ###

N, K, C = map(int, input().split())
S = str(input())

#前から貪欲に
x = 0
L = [-1] * K
p = 0
while (x < N) and (p != K):
  if S[x] == "o":
    L[p] = x
    p += 1
    x += C + 1
  else:
    x += 1

#後ろから貪欲に    
y = N - 1
R = [-1] * K
q = 0
while (y > -1) and(q != K):
  if S[y] == "o":
    R[q] = y
    q += 1
    y -= C + 1
  else:
    y -= 1
    
#print(L, R)

#LとRの被っている数に1足したものを出力
for i in range(K):
  if L[i] == R[K - i - 1]:
    print(L[i] + 1)
n = input()
print('Yes' if 7 in n else 'No')

### FIXED CODE ###

n = input()
print('Yes' if '7' in n else 'No')
n = int(input())
v = list(map(int,input().split())
c = list(map(int,input().split())
sum = 0
for i in range(n):
     if v[i] >c[i]:
      sum += v[i]-c[i]
print(sum)


### FIXED CODE ###

n = int(input())
v = list(map(int,input().split()))
c = list(map(int,input().split()))
sum = 0
for i in range(n):
     if v[i] >c[i]:
      sum += v[i]-c[i]
print(sum)
n,a,b=map(int,input().split())
A=[]
for i in range(1,n+1):
  m=0
  for j in range(len(str(i))):
    m+=str(i)[j]
  else:
    if a<=m<=b:
      A.append(i)
print(sum(A))

### FIXED CODE ###

n,a,b=map(int,input().split())
A=[]
for i in range(1,n+1):
  m=0
  for j in range(len(str(i))):
    m+=int(str(i)[j])
  else:
    if a<=m<=b:
      A.append(i)
print(sum(A))
n = input()
print(-(-n//2))


### FIXED CODE ###

N = int(input())
print(-((-N)//2))
import sys


for line in sys.stdin:
    xa1, ya1, xa2, ya2, xb1, yb1, xb2, yb2 = map(float, line.split(' '))
    if ((xa1 <= xb1 and xb1 <= xa2) or (xb1 <= xa1 and xa1 <= xb2)) and ((yb1 <= ya2 and ya2 <= yb2) or (ya1 <= yb2 and yb2 <= ya2)):
        print 'YES'
    else:
        print 'NO'

### FIXED CODE ###


import sys


for line in sys.stdin:
    xa1, ya1, xa2, ya2, xb1, yb1, xb2, yb2 = map(float, line.strip().split(' '))
    if ((xb1<=xa1 and xa1<=xb2) or (xa1<=xb1 and xb1<=xa2)) and ((yb1<=ya2 and ya2<=yb2) or (ya1<=yb2 and yb2<=ya2)):
        print 'YES'
    else:
        print 'NO'
T, A, B, C, D = map(int, raw_input().split())

if A + C <= T:
    print B + D
elif C <= T:
    print D
elif A <= T:
    print B
else:
    print 0


### FIXED CODE ###

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

NA = sum(A)
mv = float('inf')
mi = -1

for i in xrange(N):
    v = abs(NA - A[i] * N)
    if v < mv:
        mv = v
        mi = i

print mi
import sys
input = sys.stdin.readline

X,Y,A,B,C = 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()
m = [X,Y]
ans = 0
while m[0] > 0 or m[1] > 0:
    if m[0] > 0:
        if p[-1] < r[-1]:
            ans += r[-1]
            r.pop()
        else:
            ans += p[-1]
            p.pop()
        m[0] -= 1
    if m[1] > 0:
        if q[-1] < r[-1]:
            ans += r[-1]
            r.pop()
        else:
            ans += q[-1]
            q.pop()
        m[1] -= 1
print(ans)

### FIXED CODE ###

import sys
input = sys.stdin.readline

X,Y,A,B,C = map(int, input().split())
p = list(map(int, input().split()))
q = list(map(int, input().split()))
r = list(map(int, input().split()))
p.sort()
p = p[A-X:]
q.sort()
q = q[B-Y:]
r.sort()
a = p+q+r
a.sort(reverse=True)
print(sum(a[:X+Y]))
n = int(input())
a = int(input())
b = int(input())

if a*n > b:
	print(b)
else:
	print(a*n)

### FIXED CODE ###

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

if a*n > b:
	print(b)
else:
	print(a*n)
a = input()
s= input()

if a >= 3200:
  print(s)
else:
  print('red')

### FIXED CODE ###

a = int(input())
s = input()

print(s if a >= 3200 else 'red')
n,g,s = map(int,input().split())
G = [[] for _ in range(n)]
for i in range(n-1):
  a,b = map(int,input().split())
  G[a-1].append(b-1)
  G[b-1].append(a-1)
  
def dfs(v,d):
  if vs[v] != -1:
    return
  vs[v] = d
  for nv in G[v]:
    dfs(nv,d+1)

def dfs2(v,d):
  if vg[v] != -1:
    return
  vg[v] = d
  if d >= vs[v]:
    return  
  for nv in G[v]:
    dfs2(nv,d+1)
  
vs = [-1]*n
vg = [-1]*n

dfs(s-1,0)
dfs2(g-1,0)

print(max(vg))

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**6)

n,g,s = map(int,input().split())
G = [[] for _ in range(n)]
for i in range(n-1):
  a,b = map(int,input().split())
  G[a-1].append(b-1)
  G[b-1].append(a-1)
  
def dfs(V,v,d):
  if V[v] != -1:
    return
  V[v] = d
  for nv in G[v]:
    dfs(V,nv,d+1)
  
if len(G[g-1])==1 and G[g-1][0]==s-1:
  print(0)
else:
  vs = [-1]*n
  vg = [-1]*n
  dfs(vs,s-1,0)
  dfs(vg,g-1,0)
  
  ans = 0
  for i in range(n):
    if vs[i]>vg[i]:
      ans = max(ans,vs[i])
      
  print(ans-1)
import sys
import numpy as np
import collections

def parse(inp):
    N=int(next(inp))
    H=np.array(next(inp).split(),dtype=int)
    return H
  
def split(H):
    Splited=np.array([],dtype=int)
    SplitPoint=[]
    for i in range(len(H)):
        if(H[i]==0):
            SplitPoint.append(i)
    
    if(SplitPoint==[]):
        Splited=np.array([H])
        return Splited
    if(SplitPoint[0]==len(H)-1):
        Splited=np.array([np.delete([H],len(H)-1)])
        return Splited
    
    Splited=np.append(Splited,np.split(H,SplitPoint))
        
    for i in range(len(Splited)):
        if(Splited[i].size==0):
             continue
        elif(Splited[i][0]==0):
            Splited[i]=np.delete(Splited[i],[0])
    
    return Splited
                
def main(H):
    H=collections.deque(H)
#    print(H)

    answer=0
    
    while H:
        Hnow=H.popleft()
        if(Hnow.size==0):
            continue
#        print("now: ",Hnow)
        Hnowmin=Hnow.min()
        answer+=Hnowmin
        for i in range(len(Hnow)):
            Hnow[i]=Hnow[i]-Hnowmin
#        print("decreased: ",Hnow)
        for i in range(len(split(Hnow))):
            if(split(Hnow)[i].size!=0):
#                print("append: ",split(Hnow)[i])
                H.append(split(Hnow)[i])
#        print("H: ",H)
    return answer

print(main(split(parse(sys.stdin))))

### FIXED CODE ###

import sys
import numpy as np
import collections

def parse(inp):
    N=int(next(inp))
    H=np.array(next(inp).split(),dtype=int)
    return H
  
def split(H):
    Splited=np.array([],dtype=int)
    SplitPoint=[]
    for i in range(len(H)):
        if(H[i]==0):
            SplitPoint.append(i)
    
    if(SplitPoint==[]):
        Splited=np.array([H])
        return Splited
            
    Splited=np.split(H,SplitPoint)
    
            
    
    for i in range(len(Splited)):
        if(Splited[i].size==0):
             continue
        elif(Splited[i][0]==0):
            Splited[i]=np.delete(Splited[i],[0])
    
    return Splited
                
def main(H):
    H=collections.deque(H)
#    print(H)

    answer=0
    
    while H:
        Hnow=H.popleft()
        if(Hnow.size==0):
            continue
#        print("now: ",Hnow)
        Hnowmin=Hnow.min()
        answer+=Hnowmin
        for i in range(len(Hnow)):
            Hnow[i]=Hnow[i]-Hnowmin
#        print("decreased: ",Hnow)
        for i in range(len(split(Hnow))):
            if(split(Hnow)[i].size!=0):
#                print("append: ",split(Hnow)[i])
                H.append(split(Hnow)[i])
#        print("H: ",H)
    return answer

print(main(split(parse(sys.stdin))))
n = int(input())
s = [input() for i in range(n)]


def check

def yoi(s, b):
  for i in range(n):
    for j in range(i+1, n):
      if s[i % n][(j + b) % n] != s[j % n][(i + b) % n]:
        return 0
  return 1

sol = sum(yoi(s, b) for b in range(n))
print(sol * n)

### FIXED CODE ###

n = int(input())
s = [input() for i in range(n)]
st = [str().join(s_) for s_ in zip(*s)]

sol = 0

for i in range(n):
    for k in range(n):
        if s[k] != st[k]:
            break
    else:
        sol += 1
    
    s = [s_l[1:]+s_l[0] for s_l in s]
    st = st[1:] + [st[0]]
    
print(sol * n)
primes = [2,3,5,7,11,13,17,19,23,29,31]

memo1 = {}
def factorization(n):
    result = []
    for prime in primes:
        while n % prime == 0:
            n = n / prime
            result.append(prime)
    if n != 1:
        result.append(n)
    return result

def factors(l):
    p2num = {}
    for prime in l:
        if prime not in p2num:
            p2num[prime] = 2
        else:
            p2num[prime] += 1
    return reduce(lambda x,y: x * y,p2num.values())

def factors_of_factorials(n):
    l = []
    for i in range(1,n+1):
        l += factorization(i)
    return factors(l) % (10**9 + 7)


n = int(raw_input())
print factors_of_factorials(n)

### FIXED CODE ###

primes = [2,3,5,7,11,13,17,19,23,29,31]

memo1 = {}
def factorization(n):
    result = []
    for prime in primes:
        while n % prime == 0:
            n = n / prime
            result.append(prime)
    if n != 1:
        result.append(n)
    return result

def num_of_factors(l):
    if l == []:
        return 1
    if len(l) == 1:
        return 2
    p2num = {}
    for prime in l:
        if prime not in p2num:
            p2num[prime] = 2
        else:
            p2num[prime] += 1
    return reduce(lambda x,y: x * y,p2num.values())

def factors_of_factorials(n):
    l = []
    for i in range(1,n+1):
        l += factorization(i)
    return num_of_factors(l) % (10**9 + 7)


n = int(raw_input())
print factors_of_factorials(n)
D, T, S = map(int, input.split())
print("Yes" if (D / S) <= T else "No")

### FIXED CODE ###

D, T, S = map(int, input().split())
print("Yes" if (D / S) <= T else "No")
a, b = map(int, input().split())
s = str(input())
cnt = 0

for i in range(a):
    if int(s[i]) in range(0, 10):
        cnt += 1
if s[a]=='-':
    cnt += 1
for i in range(b):
    if int(s[a+1+i]) in range(0, 10):
        cnt += 1

if cnt == a+b+1:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

a, b = map(int, input().split())
s = str(input())
cnt = 0

if s.count('-')==1 and s[a]=='-':
    for i in range(a):
        if int(s[i]) in range(0, 10):
            cnt += 1
    if s[a]=='-':
        cnt += 1
    for i in range(b):
        if int(s[a+1+i]) in range(0, 10):
            cnt += 1

    if cnt == a+b+1:
        print('Yes')
    else:
        print('No')

else:
    print('No')
n = int(input())
d = list(map(int,input().split()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))
ans = sum(b)
for i in range(n):
    if(i<(n-1) and d[i]==(d[i+1]-1)):
        ans+=c[i-2]
print(ans)

### FIXED CODE ###

n = int(input())
d = list(map(int,input().split()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))
ans = sum(b)
for i in range(n):
    if(i<(n-1) and d[i]==(d[i+1]-1)):
        ans+=c[d[i]-1]
print(ans)
a,b,c = map(int,input(),split())
print(c,a,b)

### FIXED CODE ###

a,b,c = map(int,input().split())
print(c,a,b)
x,y,z,K = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))

a.sort(reverse=True)
b.sort(reverse=True)
c.sort(reverse=True)

result = [0]*K**3

ri = 0;
for i in range(min(len(a), K)):
    for j in range(min(len(b), K)):
        for k in range(min(len(c), K)):
            result[ri] = a[i] + b[j] + c[k]
            ri += 1
            
result.sort(reverse=True)

           
for i in range(K):
    print(result[i])

### FIXED CODE ###

x,y,z,k = map(int,input().split())
lisa = list(map(int,input().split()))
lisb = list(map(int,input().split()))
lisc = list(map(int,input().split()))
lisa.sort(reverse=True)
lisb.sort(reverse=True)
lisc.sort(reverse=True)
an = []
ans = []
for num in lisb:
    for nu in lisa:
        an.append(num+nu)
an.sort(reverse=True)
an = an[:min(3001,x*y*z+1)]
for num in lisc:
    for nu in an:
        ans.append(num+nu)
ans.sort(reverse=True)
for i in range(k):
    print(ans[i])
s = input()

for i in range(2**(len(s)-1)):
    plus = [""]*(len(s))
    fomula = ""
    for j in range(len(s)-1):
        if(i >> j & 1):
            plus[j] = "+"
    for k in range(len(s)):
        fomula += s[k] + plus[k]
    ans += eval(fomula)
print(ans)

### FIXED CODE ###

s = input()
ans = 0
for i in range(2**(len(s)-1)):
    plus = [""]*(len(s))
    fomula = ""
    for j in range(len(s)-1):
        if(i >> j & 1):
            plus[j] = "+"
    for k in range(len(s)):
        fomula += s[k] + plus[k]
    ans += eval(fomula)
print(ans)
s = list(str(input()))

print(s[0]+s[1]+s[2]+s[3]+s[4])+" "+s[6]+s[7]+s[8]+s[9]+s[10]+s[11]+s[12]+" "+s[14]+s[15]+s[16]+s[17]+s[18])





### FIXED CODE ###

s = input().replace(','," ")
print(s)
def trial_division(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f = f+2
    if n!= 1:  a.append(n)
    
    return a

import math
 
A,B = map(int,input().split())
 
g = math.gcd(A,B)
 
L = trial_division(g)
 
D = {}
 
for i in L :
    if i not in D :
        D[i] = 1
 
print(len(D)+1)

### FIXED CODE ###

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

    return a

from fractions import gcd

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

g = gcd(A,B)

L = trial_division(g)

D = {}

for i in L :
    if i not in D :
        D[i] = 1

print(len(D)+1)
S = input()
T = input()

print(S, end='')
print(T)

### FIXED CODE ###

S, T = input().split()
print(T + S)
import sys


def LI(): return [int(x) for x in sys.stdin.readline().split()]


def I(): return int(sys.stdin.readline())


# A
def A():


# B
def B():
    n,k=LI()
    h=LI()
    ans=0
    for i in h:
        if i>=k:
            ans+=1;
    print(ans)

# C
def C():


# D
def D():


# E
def E():


# F
def F():


# Solve
if __name__ == "__main__":
    B()

### FIXED CODE ###

import sys


def LI(): return [int(x) for x in sys.stdin.readline().split()]


def I(): return int(sys.stdin.readline())


sys.setrecursionlimit(1000000)
mod = 1000000007


# A
def A():
    return


# B
def B():
    n, k = LI()
    h = LI()
    ans = 0
    for i in h:
        if i >= k:
            ans += 1
    print(ans)
    return


# C
def C():
    return


# D
def D():
    return


# E
def E():
    return


# F
def F():
    return


# Solve
if __name__ == "__main__":
    B()
import sys

s2nn = lambda s: [int(c) for c in s.split(' ')]

ss2nn = lambda ss: [int(s) for s in list(ss)]
ss2nnn = lambda ss: [s2nn(s) for s in list(ss)]

i2s = lambda: sys.stdin.readline().rstrip()
i2n = lambda: int(i2s())
i2nn = lambda: s2nn(i2s())

ii2ss = lambda n: [sys.stdin.readline() for _ in range(n)]

def main(N, Q, S, lrs):
    S2 = [0] * (N+1)
    for i in range(N):
        if S[i] == 'A' and S[i+1] == 'C':
            S2[i+1] = S2[i] + 1
        else:
            S2[i+1] = S2[i]
    for l, r in lrs:
        count = S2[r-1] - S2[l-1] 
        print(count)

N, Q = i2nn()
S = i2s()
lr = ss2nnn(ii2ss(Q))
main(N, Q, S, lr)


### FIXED CODE ###

import sys

s2nn = lambda s: [int(c) for c in s.split(' ')]

ss2nn = lambda ss: [int(s) for s in list(ss)]
ss2nnn = lambda ss: [s2nn(s) for s in list(ss)]

i2s = lambda: sys.stdin.readline().rstrip()
i2n = lambda: int(i2s())
i2nn = lambda: s2nn(i2s())

ii2ss = lambda n: [sys.stdin.readline() for _ in range(n)]

def main(N, Q, S, lrs):
    S2 = [0] * (N)
    for i in range(1, N):
        if S[i-1] == 'A' and S[i] == 'C':
            S2[i] = S2[i-1] + 1
        else:
            S2[i] = S2[i-1]
    for l, r in lrs:
        count = S2[r-1] - S2[l-1] 
        print(count)

N, Q = i2nn()
S = i2s()
lr = ss2nnn(ii2ss(Q))
main(N, Q, S, lr)
from collections import Counter
n = int(input())
a = list(map(int, input().split()))
l = len(set(a))
if l > 3:
	print("No")
elif l == 1:
	if a[0] == 0:
		print("Yes")
	else:
		print("No")
elif n%3 != 0:
	print("No")
elif l == 2:
	if 0 not in set(a):
		print("No")
	elif a.count(0) == n//3:
		print("Yes")
	else:
		print("No")
else:
	for x in list(set(a)):
		if a.count(x) != n//3:
			print("No")
			break
	elif list(set(a))[0] ^ list(set(a))[1] == list(set(a))[2]:
		print("Yes")
	else:
		print("No")

### FIXED CODE ###

from collections import Counter
n = int(input())
a = list(map(int, input().split()))
l = len(set(a))
if l > 3:
	print("No")
elif l == 1:
	if a[0] == 0:
		print("Yes")
	else:
		print("No")
elif n%3 != 0:
	print("No")
elif l == 2:
	if 0 not in set(a):
		print("No")
	elif a.count(0) == n//3:
		print("Yes")
	else:
		print("No")
else:
	for x in list(set(a)):
		if a.count(x) != n//3:
			print("No")
			break
	else:
		if list(set(a))[0] ^ list(set(a))[1] == list(set(a))[2]:
			print("Yes")
		else:
			print("No")
h,w = map(int,input().split())
a = []
for i in range(h):
  a.append(input())

  used = [True]*(h*w)

  p = []
  for i in range(h):
    for j in range(w):
      if a[i][j] == '#':
        p.append(i*w+j)
        used[i*w+j] = False
 
 
    
res = 0
while p:
    tank = []
    for e in p:
        if e>w-1 and used[e-w]:
            tank.append(e-w)
            used[e-w] = False
        if e%w > 0 and used[e-1]:
            tank.append(e-1)
            used[e-1] = False
        if e<(h-1)*w and used[e+w]:
            tank.append(e+w)
            used[e+w] = False
        if e%w<w-1 and used[e+1]:
            tank.append(e+1)
            used[e+1] =  False
    p = tank
    res += 1
print(res-1)

### FIXED CODE ###

def main():
    h,w = map(int,input().split())
    a = []
    for i in range(h):
        a.append(input())

    used = [True]*(h*w)

    p = []
    for i in range(h):
        for j in range(w):
            if a[i][j] == '#':
                p.append(i*w+j)
                used[i*w+j] = False


    
    res = 0
    while p:
        tank = []
        for e in p:
            if e>w-1 and used[e-w]:
                tank.append(e-w)
                used[e-w] = False
            if e%w > 0 and used[e-1]:
                tank.append(e-1)
                used[e-1] = False
            if e<(h-1)*w and used[e+w]:
                tank.append(e+w)
                used[e+w] = False
            if e%w<w-1 and used[e+1]:
                tank.append(e+1)
                used[e+1] =  False
        p = tank
        res += 1
    print(res-1)

if __name__ == '__main__':
    main()
N,K = map(int,input().split()) 
numbers = list(map(int,input().split()))
num_set = set(numbers)
KindNum = len(num_set)

if KindNum < K:
    print(0)
else:
    numCount = []
    count = 0
    for num_kind in num_set:
        numCount.append(numbers.count(num_kind))
    numCount.sort()
    count = sum(numCount[:KindNum - K])
print(count)



### FIXED CODE ###

import collections as c
import numpy as np

N,K = map(int,input().split()) 
A = list(map(int,input().split()))
A_c = c.Counter(A)
A_c = sorted(list(A_c.values()))
KindNum = len(A_c)
if KindNum < K:
    print(0)
else:
    ans = sum(A_c[:KindNum - K])
    print(ans)
import fractions

def is_prime(n):
    if n == 1: return False

    for k in range(2, int(fractions.sqrt(n)) + 1):
        if n % k == 0:
            return False

    return True

X = int(input())

if is_prime(X):
    print(X)
    exit()
if X % 2 == 0:
    X += 1
while (1):
    if is_prime(X):
        print(X)
        break
    X += 2

### FIXED CODE ###

def sqrt(x):
    return x ** (.5)

def is_prime(n):
    if n == 1: return False

    for k in range(2, int(sqrt(n)) + 1):
        if n % k == 0:
            return False

    return True

X = int(input())

if is_prime(X):
    print(X)
    exit()
if X % 2 == 0:
    X += 1
while (1):
    if is_prime(X):
        print(X)
        break
    X += 2
H,W,M = list(map(int,input().split()))
import time
t1=time.time()

h = [0] * H
w = [0] * W

hw = []

for _ in range(H):
    hw.append([0] * W)

for _ in range(M):
    a,b = list(map(int,input().split()))
    h[a - 1] += 1
    w[b - 1] += 1
    hw[a - 1][b - 1] += 1
    
hm = max(h)
wm = max(w)

hp = [i for i, v in enumerate(h) if v == hm]
wp = [i for i, v in enumerate(w) if v == wm]

"""
for x in hp:
    for y in wp:
        if time.time()-t1>2.1:
            print(hm+wm)
            exit()
        if hw[x][y] == 0:
            print(hm + wm)
            exit()
else:
    print(hm + wm - 1)
"""
    




### FIXED CODE ###

h,w,m=map(int,input().split())
a=[0]*h
b=[0]*w
hw=[]
for _ in range(m):
    hh,ww=map(int,input().split())
    hw+=((hh-1,ww-1)),
    a[hh-1]+=1
    b[ww-1]+=1
    
ma=max(a)
mb=max(b)

# x_ind=[i for i,j in enumerate(a) if j==ma]
# y_ind=[i for i,j in enumerate(b) if j==mb]



cnt=0
# sonzai suru

for i,j in hw:
    if a[i]==ma and b[j]==mb:cnt+=1

if cnt==a.count(ma)*b.count(mb):
    print(ma+mb-1)
else:
    print(ma+mb)
a=input()
b=input()
if a[0]==b[2] and a[1]==b[1] and a[2]==b[0]:
  print("YES")
else:
  print("NO")

### FIXED CODE ###

a=raw_input()
b=raw_input()
if a[0]==b[2] and a[1]==b[1] and a[2]==b[0]:
  print("YES")
else:
  print("NO")