Harryxun/stf_run huggingface dataset:
S=input()
Q=[s for s in S if s != 'A']
U=list('KIHBR')
import sys
if S.count('A')>4:
    print('NO')
    sys.exit()
for i in range(len(S)-1):
    if S[i]==S[i+1]:
        print('NO')
        sys.exit()
    elif S[i]=='K' and S[i+1]!='I':
        print('NO')
        sys.exit()
    elif S[i]=='I' and S[i+1]!='H':
        print('NO')
        sys.exit()
for i in range(len(Q)):
    if Q[i]==U[i]:
        pass
    else:
        print('NO')
        break
else:
    print('YES')

### FIXED CODE ###

S=input()
Q=[s for s in S if s != 'A']
U=list('KIHBR')
import sys
if S.count('A')>4:
    print('NO')
    sys.exit()
elif len(Q)!=5:
    print('NO')
    sys.exit()
for i in range(len(S)):
    if S[i] not in list('AKIHABARA'):
        print('NO')
        sys.exit()
for i in range(len(S)-1):
    if S[i]==S[i+1]:
        print('NO')
        sys.exit()
    elif S[i]=='K' and S[i+1]!='I':
        print('NO')
        sys.exit()
    elif S[i]=='I' and S[i+1]!='H':
        print('NO')
        sys.exit()
for i in range(len(U)):
    if Q[i]==U[i]:
        pass
    else:
        print('NO')
        break
else:
    print('YES')
def resolve():
	n, k = map(int, input().split())
	if n == 1:
		print(k)
	else:
		print(k*((k-1)**(n-1)))
resolve()

### FIXED CODE ###

def resolve():
	s = input().split()
	uni = []
	for i in s:
		if i not in uni:
			uni.append(i)
	print(len(uni))
resolve()
a,b,c= map(str,input().split())
a=int(a)
c=int(c)
if b=="+":
    print(a+c)
else:
    print(a-b)

### FIXED CODE ###

a,b,c= map(str,input().split())
a=int(a)
c=int(c)
if b=="+":
    print(a+c)
else:
    print(a-c)
import collections
from math import factorial

N = int(input())
S = [input() for i in range(N)]

for i in range(N):
    S[i] = ''.join(sorted(S[i]))

c = collections.Counter(S)
values, counts = zip(*c.most_common())
counts = [i for i in counts if i > 1]

ans = 0
for c in counts:
    ans += factorial(c) / factorial(2) / factorial(c - 2)
print(int(ans))

### FIXED CODE ###

import collections
from math import factorial

from operator import mul
from functools import reduce

def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under



N = int(input())
S = [input() for i in range(N)]

for i in range(N):
    S[i] = ''.join(sorted(S[i]))

c = collections.Counter(S)
values, counts = zip(*c.most_common())
counts = [i for i in counts if i > 1]

ans = 0
for c in counts:
    ans += cmb(c, 2)
print(int(ans))
N,X = map(int, input().split())
target = list(map(int, input().split()))

distances = [abs(i - X) for i in target]

def GCD(x,y):
    if x == 0:
        return y
    else:
        return GCD(y, x % y)
res = 0
for d in distances:
    res = GCD(res, d)
print(res)

### FIXED CODE ###

N,X = map(int, input().split())
target = list(map(int, input().split()))

distances = [abs(i - X) for i in target]

def GCD(x,y):
    if y == 0:
        return x
    else:
        return GCD(y, x % y)
res = 0
for d in distances:
    res = GCD(res, d)
print(res)
#import sys
#stdin = sys.stdin

def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x)-1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())

def dfs(graph:list, node:int, start:int) -> list:
    # 未探索のノードは距離INF
    INF = float("inf")
    dist = [INF]*node
    
    # 始点ノードの距離を0とし、dfsのためのstackを作成
    dist[start] = 0
    stack = [(0,start)]
    
    while stack:
        cost, cur_node = stack.pop()

        # 未探索のノードをstackに入れる
        for nex_cost, nex_node in graph[cur_node]:
            if dist[nex_node] != INF:
                continue
            else:
                dist[nex_node] = dist[cur_node] + nex_cost
                stack.append((dist[nex_node],nex_node))
                
    return dist

def isnibu(graph:list, dist:list) -> bool:
    for i,edges in enumerate(graph):
        for _, j in edges:
            if dist[i]%2 == dist[j]%2:
                return False
    
    return True
    
    

n,m = li()

adj_lst = [set() for _ in range(n)]

for _ in range(m):
    a,b = li_()
    
    adj_lst[a].add((1,b))
    adj_lst[b].add((1,a))
    
dist = dfs(adj_lst, n, 0)

nibu = isnibu(adj_lst, dist)

ans = 0
if isnibu(adj_lst, dist):
    ans = sum([dist[i]%2 == 1 for i in range(n)]) * sum([dist[i]%2 == 0 for i in range(n)]) - m
    
else:
    ans = n*(n-1)//2 - m
    
print(ans)

### FIXED CODE ###

import sys
stdin = sys.stdin

def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x)-1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())

def dfs(graph:list, node:int, start:int) -> list:
    # 未探索のノードは距離INF
    INF = float("inf")
    dist = [INF]*node
    
    # 始点ノードの距離を0とし、dfsのためのstackを作成
    dist[start] = 0
    stack = [(0,start)]
    
    while stack:
        cost, cur_node = stack.pop()

        # 未探索のノードをstackに入れる
        for nex_cost, nex_node in graph[cur_node]:
            if dist[nex_node] != INF:
                continue
            else:
                dist[nex_node] = dist[cur_node] + nex_cost
                stack.append((dist[nex_node],nex_node))
                
    return dist

def isnibu(graph:list, dist:list) -> bool:
    for i,edges in enumerate(graph):
        for _, j in edges:
            if dist[i]%2 == dist[j]%2:
                return False
    
    return True
    
    

n,m = li()

adj_lst = [set() for _ in range(n)]

for _ in range(m):
    a,b = li_()
    
    adj_lst[a].add((1,b))
    adj_lst[b].add((1,a))
    
dist = dfs(adj_lst, n, 0)

nibu = isnibu(adj_lst, dist)

ans = 0
if isnibu(adj_lst, dist):
    ans = sum([dist[i]%2 == 1 for i in range(n)]) * sum([dist[i]%2 == 0 for i in range(n)]) - m
    
else:
    ans = n*(n-1)//2 - m
    
print(ans)
Xs = raw_input()
  Ys = raw_input()
  dp = {}
  count = 0
  a = 1

  for i in range(len(Ys) + 1):
    dp[0][i + 1] = Ys[i] 
  for j in range(len(Xs) + 1):
    dp[j + 1][0] = Xs[j]

  for i in range(1, len(Ys) + 1):
    for j in range(a + 1, len(Xs) + 1):
      if dp[j][0] == dp[i][1]:
         count = count + 1
         a = j
         break
    if dp[j][0] == dp[i][1]:
      break

   print count

### FIXED CODE ###

def solve_lcs():
    x = raw_input()
    y = raw_input()
 
    a = len(x)
    b = len(y)
    c1 = [0 for i in range(b+1)]
    for i in range(a):
        e1 = x[i]
        c2 = c1+[]
        for j in range(b):
            if e1 == y[j]:
                c1[j+1] = c2[j] + 1
            elif c1[j+1] < c1[j]:
                c1[j+1] = c1[j]
    return c1[-1]
 
n = input()
for i2 in range(n):
    print solve_lcs()
v

### FIXED CODE ###

s = input()[8]
print("A"+s+"C")
x1, y1, x2, y2 = list(map(int, input().split()))
print(((x1 - x2)**2 + (y1 - y2)**2)**0.5)

### FIXED CODE ###

x1, y1, x2, y2 = list(map(float, input().split()))
print(((x1 - x2)**2 + (y1 - y2)**2)**0.5)
import math
import sys
sys.setrecursionlimit(100000)

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

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

    return True
  
X = int(input())

def findPrime(x):
  if is_Prime(x):
    return x
  else:
    return findPrime(x+1)

print(findPrime(X))

### FIXED CODE ###

import math
import sys
sys.setrecursionlimit(100000)

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

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

    return True
  
X = int(input())

def findPrime(x):
  if is_prime(x):
    return x
  else:
    return findPrime(x+1)

print(findPrime(X))
p = input().split()

for i in range(3):
  if p[i] == p[i + 1]:
    print("Bad")
    quit()
print("Good")

### FIXED CODE ###

p = input()

for i in range(3):
  if p[i] == p[i + 1]:
    print("Bad")
    quit()
print("Good")
n = int(input())
As = list(map(int, input().split()))
    
def f(m):
    debug = m
    for a in As:
        i = m // a
        m = i * a
    return m

# 二部探索?
l = 1
r = 10**5+1
while r-l > 1:
    m = (r+l)//2
    if f(m) <= 1: l = m
    else: r = m
ans1 = r
l = 1
r = 10**5 + 1
while r-l > 1:
    m = (r+l)//2
    if f(m) <= 2: l= m
    else: r = m
ans2 = l

if ans1 >= ans2:
    print(-1)
else:
    print(ans1[1],ans2[0])

### FIXED CODE ###

K = int(input())
As = list(map(int, input().split()))

def f(n):
    for a in As:
        n = a * (n//a)
    return n

ng,ok = 1, 10**20
while ok-ng > 1:
    m = (ok+ng)//2
    if f(m) >= 2: #2以上ならTrue
        ok = m
    else:
        ng = m
mn = ok
# print(ng,ok)

ok,ng = 1, 10**20
while ng-ok > 1:
    m = (ok+ng)//2
    if f(m) <= 2: #2以下の範囲
        ok = m
    else:
        ng = m
mx = ok

# print(ok,ng)
if mn > mx:
    print(-1)
else:
    print(mn,mx)
from math import ceil,floor,factorial,gcd,sqrt,log2,cos,sin,tan,acos,asin,atan,degrees,radians,pi,inf,comb
from itertools import accumulate,groupby,permutations,combinations,product,combinations_with_replacement
from collections import deque,defaultdict,Counter
from bisect import bisect_left,bisect_right
from operator import itemgetter
from heapq import heapify,heappop,heappush
from queue import Queue,LifoQueue,PriorityQueue
from copy import deepcopy
from time import time
from functools import reduce
import string
import sys
sys.setrecursionlimit(10 ** 7)
def input() : return sys.stdin.readline().strip()
def INT()   : return int(input())
def MAP()   : return map(int,input().split())
def LIST()  : return list(MAP())

def dfs(y0, y1, x0, x1):
    global k
    m = 0
    tmp = []
    for i in range(y0, y1):
        for j in range(x0, x1):
            a[i][j] = k
            if s[i][j] == '#':
                tmp.append([i, j])
                m += 1
            if m == 2:
                break
        else:
            continue
        break
    if m == 1:
        k -= 1
    else:
        if tmp[0][0] != tmp[1][0]:
            pos = max(tmp[0][0], tmp[1][0])
            dfs(y0, pos, x0, x1)
            dfs(pos, y1, x0, x1)
        else:
            pos = max(tmp[0][1], tmp[1][1])
            dfs(y0, y1, x0, pos)
            dfs(y0, y1, pos, x1)

h, w ,k = MAP()
s = []
a = [[0]*w for i in range(h)]
for i in range(h):
    s.append(input())

dfs(0, h, 0, w)
for i in range(h):
    print(*a[i][:])

### FIXED CODE ###

from math import ceil,floor,factorial,gcd,sqrt,log2,cos,sin,tan,acos,asin,atan,degrees,radians,pi,inf,comb
from itertools import accumulate,groupby,permutations,combinations,product,combinations_with_replacement
from collections import deque,defaultdict,Counter
from bisect import bisect_left,bisect_right
from operator import itemgetter
from heapq import heapify,heappop,heappush
from queue import Queue,LifoQueue,PriorityQueue
from copy import deepcopy
from time import time
from functools import reduce
import string
import sys
sys.setrecursionlimit(10 ** 7)
def input() : return sys.stdin.readline().strip()
def INT()   : return int(input())
def MAP()   : return map(int,input().split())
def LIST()  : return list(MAP())

h, w, k = MAP()
s = []
p = []
q = []
for i in range(h):
    s.append(input())
    if s[i].count('#') > 0:
        p.append(i)
    else:
        q.append(i)

a = [[0]*w for i in range(h)]
num = 0
if p:
    for i in p:
        num += 1
        m = 0
        while s[i][m] == '.':
            a[i][m] = num
            m += 1
        if m < w:
            if s[i][m] == '#':
                a[i][m] = num
                m += 1
            if m < w:
                for j in range(m, w):
                    if s[i][j] == '#':
                        num += 1
                    a[i][j] = num

if q:
    for i in q:
        m = i
        while m < h and a[m][0] == 0:
            m += 1
        if m >= h:
            m = i
            while m > 0 and a[m][0] == 0:
                m -= 1
        a[i][:] = a[m][:]
for i in range(h):
    print(*a[i][:])
n,m = map(int,input().split()) 
print(n*m)

### FIXED CODE ###

n,m = input().split()

n=int(n)
m=float(m)*100+0.5
m=int(m)

ans = int(n*m//100)

print(ans)
n=int(input())
p=[list(map(int,input().split()))]
ans=0
den=1
for i in range(n):
  ans+=(p[i][0]**2+p[i][1]**2)**0.5
  den*=i
print(ans/den)

### FIXED CODE ###

def dis(p1,p2):
  return ((p1[0]-p2[0])**2+(p1[1]-p2[1])**2)**0.5

n=int(input())
p=[list(map(int,input().split())) for i in range(n)]
ans=0
for i in range(n):
  for j in range(i+1,n):
    ans+=dis(p[i],p[j])
print(ans*2/n)
print(int(input())*int(input()))

### FIXED CODE ###

a,b = map(int,input().split())
print(a*b)
a = input("")
b = input("")
c = input("")

return [a, b ,c]

### FIXED CODE ###

input_arr = input("").split(" ")
a, b, c = map(str, input_arr)

print(c + " " + a + " " + b)
N = int(input())
num = list(map(int,input().split()))
b= 0
for a in range(N):
  b = b * num[a]
if b > 10**18:
  print('-1')
else:
  print(b)

### FIXED CODE ###

a,b = map(int,input().split())
print(a*b)
import sys
input = sys.stdin.readline

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

pq = p[:X] + q[:Y]
pq.sort()
for i in range(min(C, A + B)):
    if pq[i] < r[i]:
        pq[i] = r[i]
print(sum(pq))

### FIXED CODE ###

import sys
input = sys.stdin.readline

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

pq = p[:X] + q[:Y]
if len(pq) < X + Y:
    pq += [0] * (X + Y - len(pq))
pq.sort()
for i in range(min(C, len(pq))):
    if pq[i] < r[i]:
        pq[i] = r[i]
print(sum(pq))
N,A,B=map(int,input().split())
if ((N*A)>B):
  print(B)
elif:
  print(N*A)

### FIXED CODE ###

N,A,B=map(int,input().split())
if ((N*A)>B):
  print(B)
else:
  print(N*A)
N,M=map(int, input().split())

groups = [1e10 for i in range(N)]
new_group = 0
for _ in range(M):
    i, j = map(int, input().split())
    i-=1
    j-=1
    if groups[i]==1e10 and groups[j]==1e10:
        groups[i] = new_group
        groups[j] = new_group
        new_group+=1
    elif groups[i]==1e10:
        group = groups[j]
        groups[i]=group
    else:
        group = groups[i]
        groups[j]=group

group_nums = [0 for _ in range(new_group)]
for g in groups:
    if g!=1e10:
        group_nums[g]+=1
print(max(group_nums))


### FIXED CODE ###

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

class UnionFind():
    def __init__(self, n):
        self.n = n # ノード数
        self.parents = [-1]*n # 各ノードごとのparent

    def find(self, x):
        # 自身が根であれば
        if self.parents[x]<0:
            return x
        # そうでなければ、再帰的に繰り返し、自身の根を探索
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        # それぞれの根
        x = self.find(x)
        y = self.find(y)

        # 根が同一であれば
        if x == y:
            return
        if self.parents[x] > self.parents[y]:
            x,y = y,x
        self.parents[x]+=self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

uf = UnionFind(N)
for _ in range(M):
    i, j = map(int, input().split())
    i-=1
    j-=1
    uf.union(i,j)

max_size = 0
for i in range(N):
    if uf.parents[i]<0:
        size = uf.size(i)
        if max_size<size:
            max_size = size
print(max_size)
import sys
import math
from collections import defaultdict
from collections import deque

sys.setrecursionlimit(1000000)
MOD = 10 ** 9 + 7
input = lambda: sys.stdin.readline().strip()
NI = lambda: int(input())
NMI = lambda: map(int, input().split())
NLI = lambda: list(NMI())
SI = lambda: input()


def main():
    H, W = NMI()
    grid = [SI() for _ in range(H)]
    step = [[-1]*W for _ in range(H)]
    que = deque()
    for h in range(H):
        for w in range(W):
            p = grid[h][w]
            if p == "#":
                que.append((h, w))
                step[h][w] = 0
    DIR = [[-1, 0], [1, 0], [0, -1], [0, 1]]
    while que:
        x, y = que.popleft()

        for dx, dy in DIR:
            if not(0 <= x+dx < H and 0 <= y+dy < W):
                continue
            if step[x+dx][y+dy] >= 0:
                continue
            que.append((x+dx, y+dy))
            step[x+dx][y+dy] = step[x][y] + 1

    print(max(map(max, *step)))



if __name__ == "__main__":
    main()

### FIXED CODE ###

import sys
import math
from collections import defaultdict
from collections import deque

sys.setrecursionlimit(1000000)
MOD = 10 ** 9 + 7
input = lambda: sys.stdin.readline().strip()
NI = lambda: int(input())
NMI = lambda: map(int, input().split())
NLI = lambda: list(NMI())
SI = lambda: input()


def main():
    H, W = NMI()
    grid = [SI() for _ in range(H)]
    step = [[-1]*W for _ in range(H)]
    que = deque()
    for h in range(H):
        for w in range(W):
            p = grid[h][w]
            if p == "#":
                que.append((h, w))
                step[h][w] = 0
    DIR = [[-1, 0], [1, 0], [0, -1], [0, 1]]
    while que:
        x, y = que.popleft()

        for dx, dy in DIR:
            if not(0 <= x+dx < H and 0 <= y+dy < W):
                continue
            if step[x+dx][y+dy] >= 0:
                continue
            que.append((x+dx, y+dy))
            step[x+dx][y+dy] = step[x][y] + 1

    print(max([max(s) for s in step]))



if __name__ == "__main__":
    main()
import bisect
def main():
    N = int(input())
    A = list(map(int, input().split()))
    A.sort()
    i = bisect.bisect_left(A, 0)
    j = bisect.bisect_right(A, 0)
    if i % 2 == 0:
        print(sum([abs(i) for i in A]))
    else:
        if i != j:
            print(sum([abs(i) for i in A]))
        elif i == N:
            print(sum([abs(i) for i in A]) - 2 * A[-1])
        else:
            if A[i] > A[i+1]:
                print(sum([abs(i) for i in A]) - 2 * A[i+1])
            else:
                print(sum([abs(i) for i in A]) - 2 * A[i])
main()


### FIXED CODE ###

import bisect
def main():
    N = int(input())
    A = list(map(int, input().split()))
    A.sort()
    i = bisect.bisect_left(A, 0)
    j = bisect.bisect_right(A, 0)
    if i % 2 == 0:
        print(sum([abs(i) for i in A]))
    else:
        if i != j:
            print(sum([abs(i) for i in A]))
        elif i == N:
            print(sum([abs(i) for i in A]) - 2 * abs(A[-1]))
        else:
            if abs(A[i-1]) > A[i]:
                print(sum([abs(i) for i in A]) - 2 * abs(A[i]))
            else:
                print(sum([abs(i) for i in A]) - 2 * abs(A[i-1]))
main()
N = int(stdin.readline().rstrip())
Hs = list(map(int, stdin.readline().rstrip().split()))

# print(Hs)

count = 0
ret_count = 0
prev_val = Hs[-1]

for H in Hs[:-1][::-1]:
    # print('prev_val: ' + str(prev_val))
    # print('H: ' + str(H))
    # print('ret_count: ' + str(ret_count))
    if prev_val <= H:
        count += 1
    else:
        if ret_count < count:
            ret_count = count
        count = 0
    prev_val = H

if ret_count < count:
    ret_count = count

print(ret_count)


### FIXED CODE ###

N = int(input().rstrip())
Hs = list(map(int, input().rstrip().split()))

# print(Hs)

count = 0
ret_count = 0
prev_val = Hs[-1]

for H in Hs[:-1][::-1]:
    # print('prev_val: ' + str(prev_val))
    # print('H: ' + str(H))
    # print('ret_count: ' + str(ret_count))
    if prev_val <= H:
        count += 1
    else:
        if ret_count < count:
            ret_count = count
        count = 0
    prev_val = H

if ret_count < count:
    ret_count = count

print(ret_count)
import re

s = input()

regex = re.compile('[ACGT]+')

l = 0

for i in range(len(s)):
    r = regex.match(s[i:])
    if r:
        l = max(l, len(r[0]))

print(l)


### FIXED CODE ###

s = input()

max_count = 0
count = 0

for i in s:
    if i not in ['A', 'C', 'G', 'T']:
        count = 0
        continue
    count += 1
    max_count = max(max_count, count)

print(max_count)
import math
a,b,c=input().split();
if math.sqrt(float(a) + float(b)) < math.sqrt(float(c)):
  print("Yes")
else:
  print("No")


### FIXED CODE ###

arr=[1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
t=int(input())
print(arr[t-1])
import math
x = map(float,raw_input().split(' '))
print pow((x[0] - x[2])**2 + (x[1] - x[3])**2)

### FIXED CODE ###

x = map(float,raw_input().split(' '))
import turtle
kame = turtle.Turtle()
kame.speed(0)
kame.goto(x[2],x[3])
print kame.distance(x[0],x[1])
#  --*-coding:utf-8-*--

def f(str):
    s = {}
    s[0] = 0
    pat = 0

    bits = [2**i for i in range(26)]
    lenOfStr = len(str)

    for c in str:
        pat ^= bits[ord(c)-97]
        s[pat] = min(
            min(s.get(pat^bit, lenOfStr) + 1 for bit in bits),
            s.get(pat, lenOfStr))

    if pat == 0:
        return 1

    return s[pat]
            
str = input()
print(f(str))



### FIXED CODE ###

#  --*-coding:utf-8-*--

def f(s):
    return 'Yes' if (s.find('AC') != -1) else 'No'

def test():
    assert f('BACD') == 'Yes'
    assert f('ABCD') == 'No'
    assert f('CABD') == 'No'
    assert f('ACACA') == 'Yes'
    assert f('XX') == 'No'


def main():
    print(f(input()))


if __name__ == '__main__':
    main()
N=int(input())
A=list(map(int,input().split()))

maxi = A[0]
for  i in range(N):
    if A[i] >= maxi:
        maxi = A[i]
    else:
        maxi = maxi
        
count = 0
position = 0
while position < N:
  for j in range(1,maxi+1):
    for i in range(position,N):
      if A[i] == j:
        count = count + 1
        break
      else:
        position = position + 1
 
if count != 0:
    print(N-count)
else:
    print(-1)

### FIXED CODE ###

a,b=map(int,input().split())
gcm=1
for i in range(1,1+min(a,b)):
  if a%i == 0 and b%i == 0:
    gcm = i
  else:
    gcm = gcm
    
print((a*b)//gcm)
def cin():  return list(map(int,input().split()))

N, K = cin()
A = cin()

dp = [[-1 for _ in range(2)] for _ in range(100)]
dp[0][0] = 0
MAX_DIGIT = 50

for i in range(1, MAX_DIGIT):
    mask = (1 << (MAX_DIGIT - i - 1))
    cnt = 0
    for j in range(N):  cnt += bool(A[j] & mask)
    cost0 = mask * cnt
    cost1 = mask * (N - cnt)
    if(dp[i - 1][1] != -1):  dp[i][1] = max(dp[i][1], dp[i - 1][1] + max(cost0, cost1))
    if(dp[i - 1][0] != -1):
        if(K & mask):  dp[i][1] = max(dp[i][1], dp[i - 1][0] + cost0)
        if(K & mask):  dp[i][0] = max(dp[i][0], dp[i - 1][0] + cost1)
        else:  dp[i][0] = max(dp[i][0], dp[i - 1][0] + cost0)
        
ans = max(dp[MAX_DIGHT - 1][0], dp[MAX_DIGHT - 1][1])
print(ans)

### FIXED CODE ###

def cin():  return list(map(int,input().split()))

N, K = cin()
A = cin()

dp = [[-1 for _ in range(2)] for _ in range(100)]
dp[0][0] = 0
MAX_DIGIT = 50

for i in range(1, MAX_DIGIT):
    mask = (1 << (MAX_DIGIT - i - 1))
    cnt = 0
    for j in range(N):  cnt += bool(A[j] & mask)
    cost0 = mask * cnt
    cost1 = mask * (N - cnt)
    if(dp[i - 1][1] != -1):  dp[i][1] = max(dp[i][1], dp[i - 1][1] + max(cost0, cost1))
    if(dp[i - 1][0] != -1):
        if(K & mask):  dp[i][1] = max(dp[i][1], dp[i - 1][0] + cost0)
        if(K & mask):  dp[i][0] = max(dp[i][0], dp[i - 1][0] + cost1)
        else:  dp[i][0] = max(dp[i][0], dp[i - 1][0] + cost0)
        
ans = max(dp[MAX_DIGIT - 1][0], dp[MAX_DIGIT - 1][1])
print(ans)
S, T = str(input().split())
A, B = map(int, input().split())
U = str(input())

if S == U:
  print(A - 1, B)
if T == U:
  print(A, B - 1)


### FIXED CODE ###

S, T = input().split()
A, B = map(int, input().split())
U = input()

if S == U:
  print(A - 1, B)
else:
  print(A, B - 1)