Harryxun/stf_run huggingface dataset:
N,M = map(int,input().split())
List = list(map(int,input().split()))

a = [0,2,5,5,4,5,6,3,7,6]

kazu = [a[List[i]] for i in range(M)]

def dddd(kazu,X):
  dp = [ [ 0 for j in range(X+1)]  for i in range(M)]

  for i in range(M):
    for j in range(X):
      if kazu[i] <= j:
        dp[i][j+1] = max(dp[i][j+1-kazu[i]] + 1,dp[i-1][j+1])
      else:
        dp[i][j+1] = dp[i-1][j+1]
  return dp[-1][-1]
   
keta = dddd(kazu,N)
List.sort(reverse=True)
ans = []

for i in range(keta):
  for aa in List:
    k = a[aa]
    if N-k > 0:
      if dddd(kazu,N-k) == keta-i-1 and keta-i-1 != 0:
        ans.append(aa)
        N = N-k
        if N == 0:
          break
        continue
    elif N == k and keta-i-1 == 0:
      ans.append(aa)
      N = 0
  if N == 0:
    break
ans.sort(reverse=True)
print(int(''.join(map(str,ans))))

### FIXED CODE ###

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

a = [0,2,5,5,4,5,6,3,7,6]

kazu = [a[List[i]] for i in range(M)]

def dddd(kazu,X):
  dp = [ [ -float('inf') for j in range(X+1)]  for i in range(M)]
  for i in range(M):
    dp[i][0] = 0

  for i in range(M):
    for j in range(X+1):
      if kazu[i] <= j:
        dp[i][j] = max(dp[i][j-kazu[i]] + 1,dp[i-1][j])
      else:
        dp[i][j] = dp[i-1][j]
  return dp[-1]
   
keta_arr = dddd(kazu,N)
keta = keta_arr[-1]
List.sort(reverse=True)
ans = []

while keta>0:
  for aa in List:
    k = a[aa]
    if N-k < 0:
      continue
    if N-k >= 0:
      if keta_arr[N-k] == keta-1:       
        ans.append(aa)
        N = N-k
        keta -= 1
        break
ans.sort(reverse=True)
print(int(''.join(map(str,ans))))
num=input().split()
a=int(num[0])
b=int(num[1])
print(max[a+b,a-b,a*b,a/b])

### FIXED CODE ###

num=input().split()
a=int(num[0])
b=int(num[1])
print(max([a+b,a-b,a*b]))
import math
A B H M = map(int, input().split())
HP = [A*math.cos(30*H), A*math.sin(30*H)]
MP = [B*math.cos(6*M), B*math.sin(6*H)]

print(math.sqrt((HP[0]-MP[0])**2 + (HP[1]-MP[1])**2))

### FIXED CODE ###

import math
A,B,H,M = map(int, input().split())
H = 60*H + M
pi = (math.pi/180)
HP = [A*math.cos(0.5*H*pi), A*math.sin(0.5*H*pi)]
MP = [B*math.cos(6*M*pi), B*math.sin(6*M*pi)]

print(math.sqrt((HP[0]-MP[0])**2 + (HP[1]-MP[1])**2))
import numpy as np

N = int(input())
S = np.frombuffer('-'+readline().rstrip(),'S1')
Q = int(input())
query = map(int,input().split())

isD = S == 'D'
isM = S == 'M'
isC = S == 'C'

cumD = isD.cumsum(dtype=np.int64)
cumM = isM.cumsum(dtype=np.int64)

for K in query:
    x = cumD.copy(); x[K:] -= cumD[:-K]
    x *= isM
    x[K+1:] -= isD[1:-K] * (cumM[K:-1] - cumM[:-K-1])
    print((x.cumsum() * isC).sum())


### FIXED CODE ###

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

import numpy as np

N = int(readline())
S = np.frombuffer(readline().rstrip(),'S1')
Q = int(readline())
query = map(int,read().split())

isD = S == b'D'
isM = S == b'M'
isC = S == b'C'

cumD = isD.cumsum(dtype=np.int64)
cumM = isM.cumsum(dtype=np.int64)

def F(K):
    """
    ・Cごとに数える。
    ・そのためには(i-K,i] 内のDMの個数を調べる（負インデックスには関係ない文字があると思っておく）
    ・区間内のDの個数、Mの個数が取得できれば、差分が取得できるので最後に累積和
    """
    # (i-K,i]内のDの個数、Mの個数
    D = cumD.copy(); D[K:] -= cumD[:-K]
    M = cumM.copy(); M[K:] -= cumM[:-K]
    # 最後がMのとき、Dの個数分増える
    DM = isM * D
    # 左端のDを捨てるとき、Mの個数分減る
    DM[K:] -= isD[:-K] * M[K-1:-1]
    np.cumsum(DM,out=DM)
    # Cごとに集計
    return DM[isC].sum()

print('\n'.join(str(F(K)) for K in query))
import math
import re
import copy
import sys

a,b,k = map(int,input().split())
l = list(range(a,b+1))
if len(l) < k:
    k = len(l)
for i in l[:k]:
    print(i)
l = l[k:len(l)]
le = len(l)
k = le-k
if k < 0:
    k = 0
for i in l[k:le]:
    print(i)

### FIXED CODE ###

import math
import re
import copy
import sys

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

for i in range(a,min(a+k,b+1)):
    print(i)

for j in range(max(b-k+1,i+1),b+1,1):
    print(j)
n=int(input());print(-(-N//2)/N)

### FIXED CODE ###

N = int(input())

print(-(-N//2)/N)
from collections import deque
N=int(input())
G=[[] for _ in range(N)]
G2=[[] for _ in range(N)]
for i in range(N-1):
  u, v, w = map(int, input().split())
  u-=1
  v-=1
  G[u].append([v, w])
  G[v].append([u, w])

color=[-1]*N
que=deque([0])
color[0]=0

while que:
  x=que.popleft()
  for y, W in G[x]:
    if color[y]==-1:
      color[y]=(color[x]+1)%2
      que.append([y])
print(*color, sep="\n")
    

  

    

### FIXED CODE ###

from collections import deque
N=int(input())
G=[[] for _ in range(N)]
for i in range(N-1):
	u, v, w = map(int, input().split())
	u,v=u-1,v-1
	G[u].append([v,w])
	G[v].append([u,w])
#print(G) #[[[1, 2]], [[0, 2], [2, 1]], [[1, 1]]]
color=[-1]*N
que=deque([0])
color[0]=0

while que:#dfs
	p=que.popleft()#直近で追加したグラフの頂点を取得
	for q, W in G[p]:#結合しているグラフの頂点を参照
		if color[q]==-1:#塗られていないなら
			color[q]=(color[p]+W)%2
			que.append(q)
print(*color, sep="\n")
n=int(input())
card={"S":[0]*13,"H":[0]*13,"C":[0]*13,"D":[0]*13}

for i in range(n):
    mark, number = input().split()
    card[mark][int(number)-1] = 1


for a in ("S","H","C","D"):
    for b in range(13):
        if cards[a][b] == 0:
            print(a,b+1)

### FIXED CODE ###

n=int(input())
card={"S":[0]*13,"H":[0]*13,"C":[0]*13,"D":[0]*13}

for i in range(n):
    mark, number = input().split()
    card[mark][int(number)-1] = 1


for a in ("S","H","C","D"):
    for b in range(13):
        if card[a][b] == 0:
            print(a,b+1)
N  = int(input())
x = map(int,input().split())
count=0
check = 0
NEW_x=[]

def roop(N,x):
    global check
    global NEW_x
    for i in x:
        if i%2==0:
            check +=1
            s = i//2
            NEW_x.append(s)


        else:
            NEW_x.append(s)

roop(N,x)

while True:
  
    x = NEW_x
    NEW_x = []
    if check ==N:
        check=0
        count+=1
        roop(N,x)
    else:
        break

print(count)



### FIXED CODE ###

N  = int(input())
x = map(int,input().split())
count=0
check = 0
NEW_x=[]

def roop(N,x):
    global check
    global NEW_x
    for i in x:
        s = i//2
        if i%2==0:
            check +=1
            
            NEW_x.append(s)


        else:
            NEW_x.append(s)

roop(N,x)

while True:
  
    x = NEW_x
    NEW_x = []
    if check ==N:
        check=0
        count+=1
        roop(N,x)
    else:
        break

print(count)
N = input()
r = N%10
if r == 2 or r==4 or r==5 or r==7 or r==9:
  print('hon')
elif r == 0 or r == 1 or r == 6 or r == 8:
  print('pon')
else:
  print('bon')


### FIXED CODE ###

N = int(input())
r = N % 10
if r == 2 or r==4 or r==5 or r==7 or r==9:
  print('hon')
elif r == 0 or r == 1 or r == 6 or r == 8:
  print('pon')
else:
  print('bon')
#!usr/bin/env python3
#from collections import defaultdict

def main():
    #Read stdin
    fl = input().split(" ")
    V = int(fl[0])
    E = int(fl[1])
    R = int(fl[2])
    #Adjacency list
    G = defaultdict(list)
    for i in range(int(E)):
        s, t, w = [int(x) for x in input().split(" ")]

    #initialized
    d = {}
    INF = float('inf')
    #INF = 10001
    for i in range(V):
        d[i] = INF
    d[R] = 0
    q = [R]
    while q:
        u = q.pop(0)
        for v in G[u]:
            if d[v[0]] > d[u] + v[1]:
                d[v[0]] = d[u] + v[1]
                q.append(v[0])

    for k in d.keys():
        if d[k] == float('inf'):
            print("INF")
        else:
            print(d[k])


if __name__ == '__main__':
    main()

### FIXED CODE ###

from collections import defaultdict
from collections import deque
from sys import stdin
#time 2.49
def sp(G,R,V):
    d = {}
    INF = float('inf')
    for i in range(V):
        d[i] = INF
    d[R] = 0
    q = deque([(0, R)])
    while q:
        (cost, v) = q.popleft()
        for (u, c) in G[v].items():
            if d[u] > d[v] + c:
                d[u] = d[v] + c
                q.append((d[u], u))
    return d

V, E, R = [int(x) for x in stdin.readline().split()]
G = defaultdict(dict)
for case in range(E):
    s, t, w = [int(x) for x in stdin.readline().split()]
    G[s][t] = w
d = sp(G, R, V)
for k in range(V):
        if d[k] == float('inf'):
            print("INF")
        else:
            print(d[k])
import sys 
input = sys.stdin.readline

n, m = map(int,input().split())
s = [0] #累積和
a = list(map(int,input().split()))
for i in range(n):
    s.append(s[i]+a[i])

mod = [0]*m
for i in s:
    mod[i%m] += 1

ans = 0
for i in mod:
    ans += i*(i-1)//2

print(ans)

### FIXED CODE ###

import sys 
input = sys.stdin.readline

n, m = map(int,input().split())
s = [0] #累積和
a = list(map(int,input().split()))
for i in range(n):
    s.append(s[i]+a[i])

mod = {} 
for i in s:
    if i%m in mod:
        mod[i%m] += 1
    else:
        mod[i%m] = 1

ans = 0
for i in mod:
    j = mod[i]
    ans += j*(j-1)//2

print(ans)
import numpy as np
Nn, Kk, Qq = input().split()
N, K, Q = int(Nn), int(Kk), int(Qq)
a = []
for q in range(Q):
    a.append(int(input()))
result = np.ones(N) * (K - Q)
for i in a:
    result[i-1] += 1
result = result > 0
for r in result:
    if r:
        print("Yes")
    else:
        print("No")

### FIXED CODE ###

import numpy as np
Nn, Kk, Qq = input().split()
N, K, Q = int(Nn), int(Kk), int(Qq)
a = []
for q in range(Q):
    a.append(int(input()))
result = np.ones(N) * (K - Q)
for i in a:
    result[i-1] += 1
result = result > 0
for r in result:
    if r:
        print("Yes")
    else:
        print("No")
a,b,k = map(int input().split())

if k>a+b:
    print("0 0")    
elif k>a:
    print("0 "+str(a+b-k))
else:
    print(str(a-k)+" "+str(b))



### FIXED CODE ###

a,b,k = map(int, input().split())
out = 0
if k>a+b:
    print("0 0")    
elif k>a:
    out = a+b-k
    print("0 "+str(out))
else:
    print(str(a-k)+" "+str(b))
N=int(input())
x=0

for i range (1,n+1):
  
  if i%2==1:
    x+=1
    
print(x/n)
    

### FIXED CODE ###

n=int(input())
x=0
for i in range(1,n+1):
  if (i%2==1):
    x+=1
    
print(x/n)
s=input()
t=input()
n=len(s)

dic={}
ans='Yes'
for i in range(n):
    if t[i] not in dic:
        dic[t[i]]=s[i]
    
    else:
        if dic[t[i]]==s[i]:
            continue
        else :
            ans='No'
            break
    
if len(dic)!len(set(dic.values())):
    ans='No'
print(ans)

### FIXED CODE ###

s=input()
t=input()
n=len(s)

dic={}
ans='Yes'
for i in range(n):
    if t[i] not in dic:
        dic[t[i]]=s[i]
    
    else:
        if dic[t[i]]==s[i]:
            continue
        else :
            ans='No'
            break
    
if len(dic)!=len(set(dic.values())):
    ans='No'
print(ans)
y= N%%1000
print(y)

### FIXED CODE ###

N=int(input())
if  N % 1000 == 0:
  print(0)
else:
    print(1000 - N % 1000)
a, b, c = map(int, input().split())
for i in range(a, b + 1):
    if c % i == 0:
        count = int(count + 1)
print(count)



### FIXED CODE ###

a, b, c = map(int, input().split())
count = int(0)
for i in range(a, b + 1):
    if c % i == 0:
        count = count + 1
print(count)
n,q=map(int,input().split())

l=[list() for i in range(n)]
c=[0]*n

def ladd(p,q):
  c[p]+=q
  for i in l[p]:
    ladd(i,q)

for i in range(n-1):
  a,b=map(int,input().split())
  l[a-1].append(b-1)

for i in range(q):
  p,q=map(int,input().split())
  ladd(p-1,q)

for i in range(n):
  print(c[i],' ',end="")
print()


### FIXED CODE ###

import sys
sys.setrecursionlimit(10**7)
input=sys.stdin.readline

n,q=map(int,input().split())
t=[[] for _ in range(n)]
c=[0 for _ in range(n)]

for i in range(n-1):
  a,b=map(int,input().split())
  t[a-1].append(b-1)
  t[b-1].append(a-1)

for i in range(q):
  p,x=map(int,input().split())
  c[p-1]+=x

def dsf(ci,pi):
  for i in t[ci]:
    if i != pi:
      c[i] += c[ci]
      dsf(i, ci)

dsf(0,-1)

print(*c)
W,H,x,y,r = map(int, raw_input().split())
if r <= x <= W-r and r <= y <= H-r:
    print ("Yes")
else:
    print ("No")

### FIXED CODE ###

W,H,x,y,r = map(int, input().split())
if r <= x <= W-r and r <= y <= H-r:
    print ('Yes')
else:
    print ('No')
S = input()
listS = list(S)
N = []
dic = ['A', 'T', 'G', 'C']
count = 0
for i in range(len(listS)):
    if listS[i] in dic:
        count += 1
        N.append(count)
    else:
        count = 0

print(max(N))

### FIXED CODE ###

S = input()
listS = list(S)
N = []
dic = ['A', 'T', 'G', 'C']
count = 0
for i in range(len(listS)):
    if listS[i] in dic:
        count += 1
        N.append(count)
    else:
        count = 0
        N.append(count)
print(max(N))
s1,s2,s3=map(input().split())
print(s1[0]+s2[0]+s3[0])

### FIXED CODE ###

s1,s2,s3=input().split()
print(str.upper(s1[0]+s2[0]+s3[0]))
import math
a, b = map(str, input().split())
ans = 0
ans += int(a) * int(b[0]) * 100
ans += int(a) * int(b[2]) * 10
ans += int(a) * int(b[3])
tmp = list(str(ans))
tmp.pop(-1)
tmp.pop(-1)
print(int("".join(tmp)))

### FIXED CODE ###

import math
import sys

a, b = map(str, input().split())
if a == "0" or b == "0.00":
  print(0)
  exit()
ans = 0
ans += int(a) * int(b[0]) * 100
ans += int(a) * int(b[2]) * 10
ans += int(a) * int(b[3])
tmp = list(str(ans))
if len(tmp) == 1 or len(tmp) == 2:
  print(0)
  exit()
tmp.pop(-1)
tmp.pop(-1)
print(int("".join(tmp)))
n, x = map(int, input().split())
l = []
for i in range(n):
    l.append(int(input())
print(int((x- sum(l)) // min(l)))

### FIXED CODE ###

n,x=map(int,input().split())
l=[int(input()) for _ in range(n)]
print(n+((x-sum(l))//min(l)))
import sys
sys.setrecursionlimit(10*5)

def dfs(pos, not_pos, tree_dict, ans_li, length):
  n_li = tree_dict[pos]
  for n, w in n_li:
    if n == not_pos:
      continue
    new_length = length+w
    if new_length%2 == 0:
      ans_li[n] = 0
    else:
      ans_li[n] = 1
    ans = dfs(n, pos, tree_dict, ans_li, new_length)
  return ans_li

def run():
  N = int(input())
  tree_dict = {}
  ans_li = [0]*(N+1)
  for n in range(N-1):
    u, v, w = map(int, input().split())
    tree_dict.setdefault(u, []).append((v, w))
    tree_dict.setdefault(v, []).append((u, w))
  length = 0
  ans = dfs(1, -1, tree_dict, ans_li, length)
  for a in ans[1:]:
    print(a)
    

if __name__ == '__main__':
  run()

### FIXED CODE ###

import sys
sys.setrecursionlimit(500*500)

def dfs(pos, not_pos, tree_dict, ans_li, length):
  n_li = tree_dict[pos]
  for n, w in n_li:
    if n == not_pos:
      continue
    new_length = length+w
    if new_length%2 == 0:
      ans_li[n] = 0
    else:
      ans_li[n] = 1
    ans = dfs(n, pos, tree_dict, ans_li, new_length)
  return ans_li

def run():
  N = int(input())
  tree_dict = {}
  ans_li = [0]*(N+1)
  for n in range(N-1):
    u, v, w = map(int, input().split())
    tree_dict.setdefault(u, []).append((v, w))
    tree_dict.setdefault(v, []).append((u, w))
  length = 0
  ans = dfs(1, -1, tree_dict, ans_li, length)
  for a in ans[1:]:
    print(a)
    

if __name__ == '__main__':
  run()
n, k = map(int, input().split())
a = [int(an) for an in input().split()]
ans = 0
set_a = set(a)
num_of_types = len(set_a)
if num_of_types > k:
  ans = sum(sorted([a.count(num) for num in set_a])[:num_of_types - k])
print(ans)

### FIXED CODE ###

print(input().count('1'))
n = int(input())
a = list(map(int, input().split()))
d = {}
for i in range(n):
  d[a[i]] = d.get(a[i], 0) + 1
data = sorted(list(set(a)))
prime_bool = [True]*(max(a)+1)
prime_bool[0] = False
count = 0
for i in range(len(data)):
  p = data[i]
  if prime_bool[p]:
    if c[p] == 1:
      count += 1
    #print(p)
    for j in range(2*p, max(a)+1, p):
      prime_bool[j] = False

print(count)



### FIXED CODE ###

import collections

n = int(input())
a = list(map(int, input().split()))
a = sorted(a)
c = collections.Counter(a)
data = sorted(list(set(a)))
max_ = max(a)+1
prime_bool = [True]*max_
prime_bool[0] = False

for i in range(len(data)):
  p = data[i]
  if prime_bool[p]:
    #print(p)
    k = 2
    while k*p < max_:
      prime_bool[k*p] = False
      k += 1

count = 0
for i in range(len(prime_bool)):
  if prime_bool[i]:
    if c[i] == 1:
      count += 1
print(count)
#print(prime_bool)
S=input()
a=0
for i in range(len(S)-1):
  if S[i]==S[i+1] or S[i]==S[i+2] :
    a=1
    print(i+1,i+3)
    break
if a==0:
    print(-1,-1)

### FIXED CODE ###

S=input()
a=0
for i in range(len(S)-2):
  if S[i]==S[i+1] or S[i]==S[i+2] or S[i+1]==S[i+2]:
    a=1
    print(i+1,i+3)
    break

if a==0:
 if len(S)>1 and S[-1]==S[-2]:
  print(len(S)-1,len(S))
 else:
  print(-1,-1)
n = int(raw_input())
 
d = [0 for i in range(n)]
f = [0 for i in range(n)]
a = [[0 for i in range(n)] for j in range(n)]
st = [0 for i in range(n)]
time = [0]
g = [0 for i in range(n)]
 
 
def dfs_visit(s):
    st[s] = 1
    time[0] += 1
    d[s] = time[0]
     
    for k in range(n):  
      if a[s][k] == 1 and st[k] == 0:
          dfs_visit(k)
    st[s] ==2
    time[0] += 1
    f[s] = time[0]
 
def main():
    for s in range(n):
        if st[s] == 0:
            dfs_visit(s)
    for s in range(n):
        print'{0} {1} {2}'.format(s+1, d[s], f[s])
 
for i in range(n):
    g = map(int, raw_input().split())
    for j in range(G[1]):
        a[g[0]-1][G[2+j]-1] = 1
 
main()

### FIXED CODE ###

n = int(raw_input())
 
d = [0 for i in range(n)]
f = [0 for i in range(n)]
a = [[0 for i in range(n)] for j in range(n)]
st = [0 for i in range(n)]
time = [0]
g = [0 for i in range(n)]
 
 
def dfs_visit(s):
    st[s] = 1
    time[0] += 1
    d[s] = time[0]
     
    for k in range(n):  
      if a[s][k] == 1 and st[k] == 0:
          dfs_visit(k)
    st[s] ==2
    time[0] += 1
    f[s] = time[0]
 
def main():
    for s in range(n):
        if st[s] == 0:
            dfs_visit(s)
    for s in range(n):
        print'{0} {1} {2}'.format(s+1, d[s], f[s])
 
for i in range(n):
    g = map(int, raw_input().split())
    for j in range(g[1]):
        a[g[0]-1][g[2+j]-1] = 1
 
main()
def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)


n = int(input())
arr = list(map(int, input().split()))
lcm = 1
for e in arr:
    lcm = int(lcm * e / gcd(lcm, e))
lcm -= 1
res = 0
for e in arr:
    res += lcm % e
print(res)


### FIXED CODE ###

n = int(input())
arr = list(map(int, input().split()))
lcm = 0
for e in arr:
    lcm += e - 1
print(lcm)
import sys
N,M,K=map(int,input().split())
s=[[]for i in range(N)]
tn=[0]*N
sys.setrecursionlimit(2000000)
for i in range(M):
    a,b=map(int,input().split())
    s[a-1].append(b)
    s[b-1].append(a)
    tn[a-1]+=1
    tn[b-1]+=1
l=[None]*N
def hu(n,t):
    for i in s[n]:
        if l[i-1]==None:
            l[i-1]=t
            hu(i-1,t)
t=0
for i in range(N):
    if l[i]==None:
        hu(i,t)
        t+=1
c=[0]*t
for i in l:
    c[i]+=1
for i in range(K):
    a,b=map(int,input().split())
    if l[a-1]==l[b-1]:
        tn[a-1]+=1
        tn[b-1]+=1
for i in range(N):
    print(c[l[i]]-tn[i]-1,end=" ")

### FIXED CODE ###

import sys
N,M,K=map(int,input().split())
s=[[]for i in range(N)]
tn=[0]*N
sys.setrecursionlimit(200000)
for i in range(M):
    a,b=map(int,input().split())
    s[a-1].append(b)
    s[b-1].append(a)
    tn[a-1]+=1
    tn[b-1]+=1
l=[None]*N
def hu(n,t):
    l[n]=t
    for i in s[n]:
        if l[i-1]==None:
            l[i-1]=t
            hu(i-1,t)
t=0
for i in range(N):
    if l[i]==None:
        hu(i,t)
        t+=1
c=[0]*t
for i in l:
    c[i]+=1
for i in range(K):
    a,b=map(int,input().split())
    if l[a-1]==l[b-1]:
        tn[a-1]+=1
        tn[b-1]+=1
for i in range(N):
    print(c[l[i]]-tn[i]-1,end=" ")
input_str = input()
items = set(list(input_str)
return 'Yes' if len(items) == 2 and len(list(input_str.replace(list(items)[0], ''))) == 2 else 'No'

### FIXED CODE ###

input_str = input()
items = set(list(input_str))
print('Yes' if len(items) == 2 and len(list(input_str.replace(list(items)[0], ''))) == 2 else 'No')
a,b=map(int,input().split())
if a==b:print(a*2)
else print(max(a,b)*2-1)


### FIXED CODE ###

a,b=map(int,input().split())
if a==b:print(a*2)
else:print(max(a,b)*2-1)
import sys
from heapq import heappush,heappop
sys.setrecursionlimit(10**9)
INF = 10**18


def input():
    return sys.stdin.readline().rstrip()


def main():
    N,K=map(int,input().split())
    S=list(map(int,list(input())))
    first=S[0]
    l=[]
    c=1
    for i in range(N-1):
        if S[i+1] == S[i]:
            c+=1
        else:
            l.append(c)
            c=1
    l.append(c)
    if K%2==1:
        if len(l) > K*2:
            ans = sum(l[:K*2])
            op=ans
            for i in range(len(l)-K*2):
                op = op-l[i]+l[K*2+i]
                ans=max(ans,op)
        else:
            ans = sum(l)
    else:
        if len(l) > K*2+1:
            ans=sum(l[:K*2+1])
            op=ans
            for i in range(not(first),len(l)-(K*2+1),2):
                op = op-(l[i]+l[i+1])+l[K*2+1+i]+l[K*2+1+i+1]
                ans = max(ans, op)
        else:
            ans=sum(l)
    print(ans)

if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
from heapq import heappush,heappop
sys.setrecursionlimit(10**9)
INF = 10**18


def input():
    return sys.stdin.readline().rstrip()


def main():
    N,K=map(int,input().split())
    S=list(map(int,list(input())))
    f=S[0]
    left1=0
    for i,x in enumerate(S):
        if x==0:
            break
        else:
            left1+=1
    l=[left1]
    tmp=0
    pre=1
    for i,x in enumerate(S[left1:]):
        if pre!=x:
                l.append(tmp)
                tmp=0
        tmp+=1
        pre=x
    l.append(tmp)
    A=[0]*(len(l)+1)
    for i in range(len(l)):
        A[i+1]=A[i]+l[i]
    ans=0
    for i in range(len(l)+1):
        if i%2:
            ans=max(ans,A[i]-A[max(0,i-K*2)])
        else:
            ans=max(ans,A[i]-A[max(0,i-K*2-1)])
    print(ans)
    

if __name__ == '__main__':
    main()
N=int(input())
sisterN=[]
SISTERn=[]
SIStern=[]
for n in range(N):
    _=int(input())
    if _<30000:
        _s= _
        if sisterN.count(_s)==1:
            sisterN.remove(_s)
        else:
            sisterN.append(_s)
    elif 30001<_<90000:
        _m= _
        if SISterN.count(_m)==1:
            SISterN.remove(_m)
        else:
            SISterN.append(_m)
    else:
        _b= _
        if SISTERn.count(_b)==1:
            SISTERn.remove(_b)
        else:
            SISTERn.append(_b)
print(len(sisterN)+len(SISTERn)+len(SIStern))

### FIXED CODE ###

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

for n in range(N):
    _=int(input())
    if _ in S:
        S.remove(_)
    else:
        S.add(_)

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

p = 2
counter = 0
while N != 1:
  ind = 0
  n = -1
  while N % p == 0:
    N //= p
    ind += 1
  while (n+1)(n+2)//2 <= ind:
    n += 1
  counter += n
  p += 1

print(counter)

### FIXED CODE ###

import math

N = int(input())

p = 2
counter = 0
while N != 1:
 if p > math.sqrt(N):
  counter += 1
  break
 ind = 0
 n = -1
 while N % p == 0:
  N //= p
  ind += 1
 if ind == 0:
  p += 1
  continue
 while (n+1)*(n+2)//2 <= ind:
  n += 1
 counter += n
 p += 1

print(counter)
a = int(input())
b = list(map(int, input().split()))

while (len(b) > 1):
	b = sorted(b)
    x = b.pop(0)
    y = b.pop(0)
    b.append((x+y)/2)
print(b[0])
pass

### FIXED CODE ###

a = int(input())
b = list(map(int, input().split()))
while (len(b) > 1):
    b = sorted(b)
    x = b.pop(0)
    y = b.pop(0)
    b.append((x+y)/2)
print(b[0])
_,*a=map(int,open(0).readlines());print(sum(a)-max(a)//2)

### FIXED CODE ###

print("Christmas"+(25-int(input()))*" Eve")
n = int(input())
ans =[]
for i in range(1,n//2+1):
     for j in range(2,10):
          if i**j <= n:
               ans.append(i**j)

print(max(ans))

### FIXED CODE ###

n = int(input())
ans =[]
for i in range(1,n//2+2):
     for j in range(2,10):
          if i**j <= n:
               ans.append(i**j)
print(max(ans))
N = int(input())
A = [int(input()) for i in range(N)]
A_sorted = sorted(A)
for i in range(N):
    if A[i] != A_sorted[-1]:
        print(A_sorted[-1])
    else:
        j = len(A_sorted) - 1
        count = 0
        while A[i] == A_sorted[j] and count =< 0:
            j -= 1
            count += 1
        print(A_sorted[j]) 


### FIXED CODE ###

N = int(input())
A = [int(input()) for i in range(N)]
A_sorted = sorted(A)
for i in range(N):
    if A[i] != A_sorted[-1]:
        print(A_sorted[-1])
    else:
        j = len(A_sorted) - 1
        count = 0
        while A[i] == A_sorted[j] and count <= 0:
            j -= 1
            count += 1
        print(A_sorted[j])