Problem:
 Score : 100 points    Problem Statement There are two buttons, one of size A and one of size B .  When you press a button of size X , you get X coins and the size of that button decreases by 1 .  You will press a button twice. Here, you can press the same button twice, or press both buttons once.  At most how many coins can you get?      Constraints  All values in input are integers.  3 \leq A, B \leq 20         Input Input is given from Standard Input in the following format:  A  B       Output Print the maximum number of coins you can get.        Sample Input 1 5 3      Sample Output 1 9  You can get 5 + 4 = 9 coins by pressing the button of size 5 twice, and this is the maximum result.       Sample Input 2 3 4      Sample Output 2 7       Sample Input 3 6 6      Sample Output 3 12

Solution (Python):
A, B = map(int, input().split())
print(max([2*A-1, 2*B-1, A+B]))

Solution (Python):
a,b=map(int,raw_input().split())
x=max(a,b)
y=min(a,b)
if x-y>1:
	print x+x-1
else:
	print x+y

Solution (Python):
a = [int(e) for e in input().split()]

if(a[0]<=a[1]):
    tmp=a[1]
    a[1]=a[1]-1
else:
    tmp=a[0]
    a[0]=a[0]-1

if(a[0]<=a[1]):
    tmp1=a[1]
    a[1]=a[1]-1
else:
    tmp1=a[0]
    a[0]=a[0]-1

print(tmp+tmp1)

Solution (Python):



il = list(input().split())

X = int(il[0])
Y = int(il[1])

count = len(il)


ans = 0
for i in range(count):
    
    
    if X < Y:
        ans += Y
        if 0 < Y:
            Y -= 1
    else:
        ans += X
        if 0 < X:
            X -= 1
        
    
    
print(ans)

Solution (Python):
A, B = map(int, input().split())
A, B = max(A, B), min(A, B)
if A - B >= 1: print(2 * A - 1)
elif A == B: print(2 * A)

Solution (Python):
A, B = map(int, input().split())
if A > B:
    ans = A
    A -= 1
else:
    ans = B
    B -= 1
ans += max(A, B)
print(ans)

Solution (Python):
a,b = map(int,input().split(" "))
ans = 0
for _ in range(2):
  if a > b:
    ans += a
    a = a - 1
  else:
    ans += b
    b = b - 1
print(ans)

Solution (Python):
i = list(map(int,input().split()))
c = 0
if i[0] != i[1]:
    if i[0] > i[1]:
        c = 2 * i[0] - 1
    else:
        c = 2 * i[1] - 1
else:
    c = 2 * i[0]
print(c)

Solution (Python):
A, B = list(map(int, input().split()))

coin = 0
if A>B:
    coin+=A
    A-=1
else:
    coin+=B
    B-=1

if A>B:
    coin+=A
    A-=1
else:
    coin+=B
    B-=1

print(coin)

Solution (Python):


"""
Created on Fri Mar  1 19:29:34 2019

@author: nakamuratakayuki
"""
A,B = tuple(map(int, input().split()))

if 1 <= abs(A-B):
    print(max(A,B)*2-1)
else:
    print(max(A,B)*2)

Solution (Python):
buttons = input().split(' ')
but1 = 0
but2 = 0
a = int(buttons[0])
b = int(buttons[1])

if a >= b:
    but2 = a - 1
else:
    but2 = b - 1


if a > b:
    print (a + but2) 
elif a == b:
    print(a + but2 + 1)
else:
    print(b + but2)

Solution (Python):
a,b=(int(x) for x in input().split())
if a>b:
    c=a+(a-1)
    print(c)
elif a==b:
    c=a+b
    print(c)
else:
    c=b+(b-1)
    print(c)

Solution (Python):
A, B = map(int,input().split())

if A==B:
  print(A+B)
elif A>=(B+2):
  print(A+(A-1))
elif A>=(B+1):
  print(A+(A-1))
else:
  print(B+(B-1))

Solution (Python):
w = input().split()
 
a = int(w[0])
b = int(w[1])
 
c = 0
for i in range(2):
  if a>=b:
    c += a
    a -= 1
  else:
    c += b
    b -= 1
 
print(c)

Solution (Python):
a,b=map(int,input().split())
if a>b:
    print(2*a-1)
elif a<b:
    print(2*b-1)
else:
    print(2*a)

Solution (Python):
a = list(map(int,input().split()))
ans = 0
a.sort(reverse = True)
ans += a[0]
a[0] -= 1
a.sort(reverse = True)
ans += a[0]
print(ans)

Solution (Python):
a, b = map(int, input().split())
if a > b:
    print(a + (a - 1))
elif a < b:
    print(b + (b - 1))
else:
    print(a + b)

Solution (Python):


A, B = [int(x) for x in input().split()]
if A>B:
  ans = A + A-1
elif B>A:
  ans = B+B-1
else:
  ans = 2*A

print(ans)

Solution (Python):
a,b = map(int,(input().split()))
if a == b:
    ans = a*2
    print(ans)
else:
    big = max(a,b)
    ans = big + (big-1)
    print(ans)

Solution (Python):
A,B = map(int,input().split())

buttons = [A,B]
max1 = max(buttons)
buttons[buttons.index(max1)] -= 1
max2 = max(buttons)

print(max1+max2)

Solution (Python):
l = []
l = [int(i) for i in input().split()] 
sum = 0

for i in range(2):
	if l[0] >= l[1]:
		sum = sum + l[0]
		l[0] = l[0] - 1
	else:
		sum = sum + l[1]
		l[1] = l[1] - 1

print(sum)

Solution (Python):
A,B =map(int,input().split())

a = A+A-1
b = A+B
c = B+B-1
print(max(a,b,c))

Solution (Python):
def main():

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

    coin = 0

    if A > B:
        coin += A
        A -= 1
    else:
        coin += B
        B -= 1

    if A > B:
        coin += A
        A -= 1
    else:
        coin += B

    print(coin)


main()

Solution (Python):
def A():
    A, B = input().split(" ")
    A = int(A)
    B = int(B)

    if A==B:
        print(A * 2)
    else:
        m = max(A,B)
        print(m + m-1)


if __name__ == '__main__':
    A()

Solution (Python):
a, b = input().split()
a, b = int(a), int(b)

print(max([a+a-1, b+b-1, a+b]))

Solution (Python):
import sys
a,b=map(int,input().split())
ans = max(a,b)
if a == b:
    print(a+b)
    sys.exit()

print(ans+(ans-1))

Solution (Python):
arr = input().split(" ")
A = int(arr[0])
B = int(arr[1])

if A == B:
  print(A + B)
elif A > B and (A - B) == 1:
  print(A + (A -1))
elif A > B and (A - B) >= 2:
  print(A + (A - 1))
elif A < B and (B - A) == 1:
  print(A + B)
elif A < B and (B - A) >= 2:
  print(B + (B -1))

Solution (Python):
A,B=map(int, input().split())


sum_n=0;

for i in range(2):
  if A>B:
    sum_n=sum_n+A
    A=A-1
  else:
    sum_n=sum_n+B
    B=B-1
    
print(sum_n)

Solution (Python):

import sys



def solve(lines):
    A,B = map(int, lines.pop(0).split(' '))
    res = 0
    for i in range(2):
        if A > B:
            res += A
            A -= 1
        else:
            res += B
            B -= 1
    print(res)


lines = [x.strip() for x in sys.stdin.readlines()]




solve(lines)

Solution (Python):
A, B = map(int, input().split())

ans = 0

for i in range(2):
  if B > A:
    ans += B
    B -= 1
  else:
    ans += A
    A -= 1
 
print(ans)

Solution (Python):
A, B = map(int, input().split())
if A>B: print(A+A-1)
elif A == B: print(2*A)
else: print(B+B-1)

Solution (Python):
a, b = map(int, open(0).read().split())
if a < b:
  c = 2 * b - 1
  print(c)
elif a == b:
  c = 2 * a
  print(c)
else:
  c = 2 * a -1
  print(c)

Solution (Python):
A, B = map(int,input().split())
if A > B:
    print(int(A) + int(A) - 1)
elif B > A:
    print(int(B) + int(B) - 1)
else:
    print(int(A) + int(A))

Solution (Python):
s = input().split()
A = int(s[0])
B = int(s[1])
if 3 <= A and B <= 20:
    C = int(A + A - 1)
    D = int(A + B)
    F = int(B + B - 1)
    print(max([C,D,F]))

Solution (Python):
import numpy as np
a,b= map(int,input().split())
max_number = np.array([a+b,2*a-1,2*b-1]).max()
print(max_number)

Solution (Python):



b,c = map(int,raw_input().split())
sum = 0
for i in range(2):
    if b<c:
        sum += c
        c = c-1
    else:
        sum += b
        b = b-1

print sum

Solution (Python):
total=0
A,B = map(int,input().split(" "))
if A>=B:
    tmp=B
    B=A
    A=tmp
total+=B
B=B-1
if A>=B:
    tmp=B
    B=A
    A=tmp
total+=B
print(total)

Solution (Python):



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

s = [a, b]
s = sorted(s)
sum = 0
sum += s[-1]
s[-1] -=1

s = sorted(s)
sum += s[-1]

print(sum)

Solution (Python):
A= sorted(list(map(int, input().split())))
B = [A[1] -1, A[0]]
print(sorted(B)[1]+A[1])

Solution (Python):

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

if A > B:
  print(A + max(A - 1, B))
else:
  print(B + max(A, B - 1))

Solution (Python):
a,b=map(int,input().split())
s=0
if a>b:
    s+=a
    a=a-1
else:
    s+=b
    b=b-1
if a>b:
    s+=a
else:
    s+=b
print(s)

Solution (Python):
A,B=map(int,input().split())
X=int(0)
for i in range(2):
    if A>B:
        X+=int(A)
        A=A-1
    else:
        X+=int(B)
        B=B-1
  
print(X)

Solution (Python):
a,b = list(map(int , input().split()))

if a > b : print(a + a - 1)
elif a == b : print(a * 2)
else : print(b + b - 1)

Solution (Python):
def main():
    a, b = [int(s) for s in input().split()]

    big = a if a > b else b
    small = b if a >= b else a
    sum = 0
    for i in range(0, 2):
        sum += big
        big -= 1
        if big <= small:
            big = small

    print(sum)


if __name__ == '__main__':
	main()

Solution (Python):
A,B = map(int, input().split())

count = max([A, B])
count += max([count-1, min(A, B)])
print(count)

Solution (Python):
a, b = map(int, input().split())
if a == b:
  print(a*2)
else:
  print(max(a,b)+max(a-1,b-1))

Solution (Python):
A, B= map(int, input().split())
sum = 0
i=0
while i < 2:
    if A >= B:
        sum += A
        A -= 1
    else:
        sum+= B
        B -= 1
    i +=1

print(sum)

Solution (Python):
x,y = map(int,input().split())
a = 0
for i in range(2):
  if x >= y:
    a+=x
    x = x-1
  else:
    a+=y
    y = y -1
print(a)

Solution (Python):
a, b = map(int, input().split())
if a > b:
    print(2 * a - 1)
elif a == b:
    print(2 * a)
else:
    print(2 * b - 1)

Solution (Python):
input = input().split(" ")
A,B = int(input[0]),int(input[1])

res = 0
for i in range(2):
  if A > B:
    res += A
    A -= 1
  else:
    res += B
    B -= 1

print(res)

Solution (Python):



inp = input()

input_list = inp.split()

a = int(input_list[0])
b = int(input_list[1])

count = 0

for i in range(2):
    if a < b:
        count += b
        b -= 1
    else:
        count += a
        a -= 1

print(count)

Solution (Python):
a, b = map(int, input().split())
x = 0

for i in [0, 1]:
    if a > b:
        x += a
        a -= 1
    else:
        x += b
        b -= 1

print(x)

Solution (Python):
inputs = input()
a = int(inputs.split(" ")[0])
b = int(inputs.split(" ")[1])
l = [a+b, a+a-1, b+b-1]
print(max(l))

Solution (Python):
A,B = map(int, input().split())
if(B > A):
  print(B + B - 1)
elif(A == B):
  print(A + B)
else:
  print(A + A - 1)

Solution (Python):
a, b = [int(x) for x in input().split()]
if a==b:
  print(2*a)
if a<b:
  print(2*b-1)
if a>b:
  print(2*a-1)

Solution (Python):
num = sorted(map(int, input().split()), reverse=True)


if num[0] == num[1]:
  print(sum(num))
else:
  print(num[0] + num[0] - 1)

Solution (Python):
a = list(map(int, input().split(' ')))
res = max(a)
a.remove(res)
a.append(res - 1)
res = res + max(a)
print(res)

Solution (Python):
a,b=map(int,input().split())
coin = 0
for i in range(0,2):
    if a > b:
        coin += a
        a = a-1
    elif b > a:
        coin += b
        b = b-1
    else:
        coin += a
        a = a-1
print(coin)

Solution (Python):
X = list(map(int, input().split()))

ans = 0
ans += max(X)
X.append(max(X) - 1)
X.remove(max(X))

ans += max(X)
print(ans)

Solution (Python):
ab = list(map(int, input().split()))

if ab[0]  == ab[1]:
  print(ab[0]*2)
else:
  ab.sort()
  print(ab[1] + ab[1] - 1)

Solution (Python):
A,B = map(int, input().split())

if A > B:
    if A-1 >B:
        print(A+(A-1))
    else:
        print(A+B)
elif A == B:
    print(A+B)
else:
    if B-1 >A:
        print(B+(B-1))
    else:
        print(A+B)

Solution (Python):
n=input().split(" ")
a=int(n[0])
b=int(n[1])
total=0

if a>b:
    total+=a
    a=a-1
elif a<=b:
    total+=b
    b=b-1
if a>b:
    total+=a
    a=a-1
elif a<=b:
    total+=b
    b=b-1

print(total)

Solution (Python):
A, B = map(int, input().split())
r =0
if A > B:
  r+=A
  A-=1
else:
  r += B
  B-=1
 
r+=max(A,B)
print(r)

Solution (Python):
a, b = map(int, input().split())
print(max(a+b, 2*a-1, 2*b-1))

Solution (Python):
A, B = map(int, input().split())
if max(A,B) - min(A,B) >= 1:
    answer = max(A,B) * 2 - 1
else:
    answer = 2 * max(A,B)
print(answer)

Solution (Python):
A,B = map(int, input().split())
sum = 0

if(A > B):
    sum = A+(A-1)
elif(A==B):
    sum = A+B
else:
    sum = B+(B-1)

print(sum)

Solution (Python):
btns=input().split()
X=int(btns[0])
Y=int(btns[1])
Coins=0

for i in range(2):
    if X > Y:
        Coins+=X
        X -= 1
    else:
        Coins+=Y
        Y-=1

print(Coins)

Solution (Python):
def pushb(n):
    if n[0] > n[1]:
        ans = n[0]
        n[0] -= 1
    else :
        ans = n[1]
        n[1] -= 1
    return ans

nlist = input().split()
nlist = [int(i) for i in nlist]

ans = 0
ans += pushb(nlist)
ans += pushb(nlist)
print(ans)

Solution (Python):
a,b=map(int,input().split())
ans=0
for aa in range(2):
    if(a<b):
        ans=b+ans
        b=b-1
    else:
        ans=a+ans
        a=a-1
print(str(ans))

Solution (Python):

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

x=0

if a-1>=b:
    x = 2*a-1
elif b-1>=a:
    x = 2*b-1
else:
    x = a + b

print(x)

Solution (Python):
a,b = map(int, input().split())

if a>b:
    print(a*2-1)
elif b>a:
    print(b*2-1)
else:
    print(a+b)

Solution (Python):
A, B = map(int, input().split())
if A == B:
    print(A * 2)
else:
    print(max(A, B) + (max(A, B) - 1))

Solution (Python):
ans = 0
ab = list(map(int,input().split()))

for i in range(2):
    if ab[0] > ab[1]:
        ans += ab[0]
        ab[0] -= 1
    elif ab[0] < ab[1]:
        ans += ab[1]
        ab[1] -= 1
    else:
        ans += ab[0]
        ab[0] -= 1

print(ans)

Solution (Python):


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

if A == B:
    print(A*2)

elif A > B:
    print(A + A - 1)

else:
    print(B + B - 1)

Solution (Python):
a, b = input().split()
a = int(a)
b = int(b)

c = 0
res = 0

while(c < 2):
    if(a > b):
        res += a
        a -= 1
    else:
        res += b
        b -= 1

    c += 1

print(res)

Solution (Python):
a,b = map(int,input().split())
 
ans = 0
c = max(a,b)
d = min(a,b)
ans += c
c -= 1
e = max(c,d)
f = min(a,b)
ans += e
 
print(ans)

Solution (Python):
a, b = map(int, input().split())
print(max(a + max(a - 1, b),b + max(a, b - 1)))

Solution (Python):
ab = input().split()
ab[0] = int(ab[0])
ab[1] = int(ab[1])
coin = 0
for i in range(2):
  if ab[0] >= ab[1]:
    coin += ab[0]
    ab[0] = ab[0] - 1 
  else:
    coin += ab[1]
    ab[1] = ab[1] - 1 
print(coin)

Solution (Python):
A, B = (int(i) for i in input().split())

num1 = max(A, B)
list = [A, A-1, B, B-1]
list.remove(num1)
num2 = max(list)

num = num1 + num2
print(num)

Solution (Python):



def main():
    buttons = raw_input()
    buttons = buttons.split()
    ans = 0
    cnt = 0
    A = int(buttons[0])
    B = int(buttons[1])
    while cnt < 2:
        if A > B:
            ans += A
            A = A - 1
        elif A < B:
            ans += B
            B = B - 1
        elif A == B:
            ans += A
            A = A - 1
        cnt += 1
    print(ans)
main()

Solution (Python):

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

ans = a+b if a==b else max(a,b)*2 -1

print(ans)

Solution (Python):
A,B = input().split(' ')
A = int(A)
B = int(B)
score = 0

for i in range(2):
    if A >= B:
        score += A
        A -= 1
    elif A < B:
        score += B
        B -= 1

print(score)

Solution (Python):
def main():
  a,b=map(int, input().split())  

  if a>=b:
    print(a+max(a-1,b))
  else:
    print(b+max(a,b-1))
          
main()

Solution (Python):
a,b = map(int, input().split())
coin = 0
a2 = 0
coin = 0
a2 = 0
b2 = 0
if a > b :
  coin += a
  a2 = a-1
  if a2 > b :
    coin += a2
  else :
    coin += b
else :
  coin += b
  b2 = b-1
  if b2 > a :
    coin += b2
  else :
    coin += a
print(coin)

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

if a < b:
  print(b+b-1)
elif a == b:
  print(a+b)
elif a > b:
  print(a+a-1)

Solution (Python):
A,B = map(int,input().split())

answer = 0
for i in range(2):
    if A < B:
        answer += B
        B -= 1
    else:
        answer += A
        A -= 1

print(answer)

Solution (Python):

def main():
	A,B = map(int,input().split())
	res = A if A >= B else B
	if res == A :
		A -= 1
	else :
		B -= 1
	res += A if A>=B else B
	print(res)

if __name__ == "__main__" :
	main()

Solution (Python):
A, B = map(int,input().split())

print(max(2*A-1, A+B, 2*B-1))

Solution (Python):
a, b = (int(i) for i in input().split())

if a == b:
	print(2 * a)
elif a > b:
	print(2 * a - 1)
else:
	print(2 * b - 1)

Solution (Python):
import collections as c
ip = lambda : map(int, input().split())


x,y = ip()
print(max([x+x-1,x+y,y+y-1]))

Solution (Python):
a, b = map(int, input().split())
if a == b:
    print(a*2)
else:
    m = max(a, b)
    print(m*2-1)

Solution (Python):
read = input
A,B = map(int , read().split())
if A > B:
    A,B = B,A
if A == B:
    print(A*2)
else :
    print(B*2 - 1)

Solution (Python):
A,B=map(int,input().split())
if A>=B:
    a=A-1
    if a>=B:
        print(A+a)
    else :
        print(A+B)
elif B>A:
    b=B-1
    if b>=A:
        print(b+B)
    else :
        print(B+A)

Solution (Python):
import sys


st = input().split()

fl = [ int(x) for x in st]

num_sum = 0


for k in range(2):
    if fl[0] >= fl[1]:
        i = 0
    else:
        i = 1

    num_sum += fl[i]
    fl[i] -= 1

print(num_sum)

Solution (Python):


a,b = map(int, input().split())
x = 0
for i in range(2):
	if a>=b : 
		x=x+a
		a=a-1
	elif a<b :
		x=x+b
		b=b-1
print(x)

Solution (Python):
a,b=map(int,input().split())
m=0
if a>b:
    m+=a
    a=a-1
else:
    m+=b
    b=b-1
m+=max(a,b)
print(m)

Solution (Python):
ls = list(map(int, input().split()))
if abs(ls[0]-ls[1]) <= 1:
  print(ls[0]+ls[1])
else:
  print(2*max(ls)-1)

Solution (Python):
a, b = map(int, input().split())

final = 0
if a > b:
    final += a
    a -= 1
    final += a if a > b else b
else:
    final += b
    b -= 1
    final += a if a > b else b

print(final)

Solution (Python):


a,b=map(int,input().split())
x=0
y=0
if a>=b:
    x=x+a
    a=a-1
else:
    x=x+b
    b=b-1
if a>=b:
    y=y+a
else:
    y=y+b

print(x+y)

Solution (Python):


list = [int(a) for a in input().split()]


list.sort()

num = 0
if list[1] > list[0] + 1:
    num = list[1] * 2 - 1
else:
    num = sum(list)

print(num)

Solution (Python):
A, B = map(int, input().split())
if A == B:
    print(A+B)
else:
    print(2*max(A, B)-1)

Solution (Python):
a,b=map(int,input().split())
print(max(2*a-1,2*b-1,a+b))

Solution (Python):
a, b = map(int, input().split())

print(max([a + b, a + a - 1, b + b - 1]))

Solution (Python):
a, b = map(int, input().split())

out = 0
for i in range(2):
    if a > b:
        out += a
        a -= 1
    else:
        out += b
        b -= 1
print(out)

Solution (Python):
a,b = map(int,input().split())

res = 0
if a>b:
  res+=a
  a-=1
else:
  res+=b
  b-=1
print(res+max(a,b))

Solution (Python):
l = list(map(int, input().split(' ')))
l.sort()
tmp = l[1]
if (l[1]-1<l[0]):
    print(l[1]+l[0])
elif(l[1]==l[0]):
    print(l[0]+l[1])
else :
    print(l[1]*2-1)

Solution (Python):
a = list(map(int,input().split()))
if a[0] == a[1]:
  print(a[0]*2)
else:
  print(max(a)*2-1)

Solution (Python):
import sys

def solve(a, b):
    x = max(a, b)
    y = min(a, b)
    if x > y + 1:
        return 2 * x - 1
    else:
        return x + y

if __name__ == '__main__':

    a, b = sys.stdin.readline().strip().split(" ")
    ans = solve(int(a), int(b))
    print ans

Solution (Python):
a,b = sorted(list(map(int, input().split())))
if b-a > 0:
	print(2 * b - 1)
else:
	print(2 * b)

Solution (Python):

import sys
import math
from bisect import bisect_left
from bisect import bisect_right
input = sys.stdin.readline




def main():
	A, B = map(int, input().split(" "))

	ans = 0
	if A <= B:
		ans += B
		B -= 1
	else:
		ans += A
		A-= 1
	if A <= B:
		ans += B
		B -= 1
	else:
		ans += A
		A-= 1

	print(ans)

	
	
if __name__ == "__main__":
	main()

Solution (Python):
a, b = map(int, input().split())
result = 0

for i in range(2):
    if a >= b:
        result += a
        a -= 1
    else:
        result += b
        b -= 1

print(result)

Solution (Python):
a,b = map(int,input().split())

if a > b :
    print(2*a-1)
elif b > a:
    print(2*b-1)
elif a == b:
    print(a+b)

Solution (Python):
a,b=map(int,input().split())
if a==b:
    print(2*a)
else:
    m=max(a,b)
    print(2*m-1)

Solution (Python):
l = list(map(int, input().split(" ")))
l.sort(reverse = True)

if(l[0] - l[1] >= 2):
    print(l[0] + l[0] - 1)
else:
    print(l[0] + l[1])

Solution (Python):
A, B = map(int, input().split())
ans = 0

if A >= B:
    ans += A
    A -= 1
else:
    ans += B
    B -= 1

if A >= B:
    ans += A
    A -= 1
else:
    ans += B
    B -= 1

print(ans)

Solution (Python):
nums_str = input()
nums_str_arr = nums_str.split(' ')
a = int(nums_str_arr[0])
b = int(nums_str_arr[1])

sum_score = 0

for i in range(2):
    if a > b:
        sum_score += a
        a -= 1
    else :
        sum_score += b
        b -= 1

print(sum_score)

Solution (Python):
a, b = map(int, input().split())
sub = abs(a-b)

if sub >= 1:
    print(max(a, b)*2 - 1)
else:
    print(a*2)

Solution (Python):
a,b = map(int,input().split())

l_button = max([a,b])

if a == b:
  l_button += l_button
else:  
  l_button += (l_button-1)

print(l_button)

Solution (Python):
inputlist = input().split()
a = int(inputlist[0])
b = int(inputlist[1])
answer = 0
for _ in range(2):
    if a < b:
        answer += b
        b -= 1
    else:
        answer += a
        a -= 1

print(answer)

Solution (Python):
a,b=map(int,input().split())
res=0
if a>=b:
  res+=a
  a-=1
else:
  res+=b
  b-=1
if a>=b:
  res+=a
  a-=1
else:
  res+=b
  b-=1
print(res)

Solution (Python):
a, b = map(int, input().split())
print(max(2*a-1, 2*b-1, a+b))

Solution (Python):
input = input()
splitedinput = input.split(" ")
num1 = int(splitedinput[0])
num2 = int(splitedinput[1])
if num1 < num2:
  num3 = int(num2) - int(num1)
elif int(num2) < int(num1):
  num3 = int(num1) - int(num2)
elif num2 == num1:
  num3 = 0
if num3 >= 2:
  toadd = max(num1, num2)
  result = toadd * 2
  result = int(result) - 1
  print(result)
else:
  result = num1 + num2
  print(result)

Solution (Python):
coin_a, coin_b = [int(a) for a in input().split()]

if coin_a == coin_b:
    print(coin_a + coin_b)
elif coin_a > coin_b:
    print((coin_a * 2) - 1)
else:
    print((coin_b * 2) - 1)

Solution (Python):
a, b = map(int, input().split())
ans = 0
for i in range(2):
    x = int(max(a, b))
    ans += x
    if x == a:
        a -= 1
    else:
        b -= 1
print(ans)

Solution (Python):
a, b = map(int, input().split())
if a < b:
    a, b = b, a
if a-b > 1:
    print(a*2-1)
else:
    print(sum([a,b]))

Solution (Python):
a, b = map(int, input().split())
if a == b:
  print(2*a)
else:
  print(max(a, b)*2-1)

Solution (Python):
button=list(map(int, input().split()))
button.append(button[0]-1)
button.append(button[1]-1)
button.sort(reverse=True)
print(button[0]+button[1])

Solution (Python):
a, b = map(int, input().split())
print(max(a + b, 2 * a  -  1, 2*b - 1))

Solution (Python):
button = [int(i) for i in input().split()]
ans = 0
for i in range(2):
    if button[0] > button[1] or button[0] == button[1]:
        ans += button[0]
        button[0] -= 1
    else:
        ans += button[1]
        button[1]-= 1


print(ans)

Solution (Python):
a,b=map(int, input().split())
print(max(a + b, a + a - 1, b + b - 1))

Solution (Python):


a, b = list(map(int, input().rstrip().split(' ')))
result = 0

for _ in range(2):
	if a > b:
		result += a
		a -= 1
	else:
		result += b
		b -= 1

print(result)

Solution (Python):
a, b = map(int, input().split())

if a == b:
    print(a + b)
elif a > b:
    print(a + a - 1)
else:
    print(b + b - 1)

Solution (Python):
l = sorted([int(i) for i in input().split()])
if l[1]-1>=l[0]:
  print(l[1]*2-1)
else:
  print(l[0]+l[1])

Solution (Python):
import numpy as np
x = input().split()
y = np.empty(2)
y[0] = int(x[0])
y[1] = int(x[1])
max = 0
if y[0] >= y[1]:
    max += y[0]
    y[0] = y[0] - 1
else:
    max += y[1]
    y[1] = y[1] -1

if y[0] >= y[1]:
    max += y[0]
else:
    max += y[1]
print(int(max))

Solution (Python):
a,b = (int(i) for i in input().split())  
sum = 0
sum += max(a,b)
if a > b:
  a -= 1
else:
  b -= 1
sum += max(a,b)
print(sum)

Solution (Python):
a,b = map(int,input().split())	

if a>b and a-1>=b:
    print(a+a-1)
    
elif a>b and a-1<b:
    print(a+b)

elif a<b and a<=b-1:
    print(b+b-1)

elif a<b and a >b-1:
    print(b+a)
    
else:
    print(a+b)

Solution (Python):
A, B = map(int, input().split())
calc = 0
for _ in range(2):
    if A >= B:
        calc += A
        A -= 1
    elif B > A:
        calc += B
        B -= 1
print(calc)

Solution (Python):

import copy
import numpy as np
import random
import bisect 
import math


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

ans = 0
if a > b:
    ans += a
    a -= 1

else:
    ans += b
    b -= 1

ans += max(a,b)
print(ans)

Solution (Python):
A,B = map(int,input().split())
X = max(A,B)
Y = min(A,B)
if X+Y >= 2:
    print(max(A,B)+max(max(A,B)-1,min(A,B)))
else:
    print(X+Y)

Solution (Python):
a,b = map(int, input().split())
coin = max(a,b)

if a>b:
  a -= 1
else:
  b -= 1

coin += max(a,b)
print(coin)

Solution (Python):
A, B = map(int, input().split())
ans = [A + B, A + A - 1, B + B -1]
print(max(ans))

Solution (Python):






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





if A > B:
    print(2 * A -1)
elif A == B:
    print(A + B)
else:
    print(2 * B -1)

Solution (Python):
A, B = map(int, input().split())

if not A == B:
    print(max(A, B) * 2 - 1)
else:
    print(A * 2)

Solution (Python):
a, b = map(int, input().split())
cnt = 0
for i in range(2):
    if a >= b:
        cnt += a
        a -= 1 
    else:
        cnt += b
        b -= 1

print(cnt)

Solution (Python):
A,B=(int(i) for i in input().split())
if A!=B:
    tmp=max(A,B)
    print(tmp*2-1)
else:
    print(2*A)

Solution (Python):


from sys import stdin

A, B = [int(x) for x in stdin.readline().rstrip().split()]

s = 0
for i in range(2):
    if  A >= B:
        s += A
        A -= 1
    else:
        s += B
        B -= 1

print(s)

Solution (Python):
a,b = map(int,input().split())
ans = max(a+b,a+a-1,b+b-1,a+b-1,a-1+b)
print(ans)

Solution (Python):

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


print(max(a+a-1,b+b-1,a+b))

Solution (Python):
a=list(map(int,input().split(" ")))
x,y=sorted(a)
if(y-1>x):
    print(y+y-1)
else:
    print(y+x)

Solution (Python):


import sys

debug = False

def log(text):
    if debug:
        print(text)

def parse_input(lines_as_string = None):

    global debug
    lines = []
    if lines_as_string is None:
        debug = False
        lines.append(input())
    else:
        debug = True
        lines = [e for e in lines_as_string.split("\n")][1:-1]


    token = lines[0].split()
    a = int(token[0])
    b = int(token[1])

    return (a, b)


def solve(a, b):

    if debug:
        log("a=%s" % a)
        log("b=%s" % b)
        
    tmp_a = a
    tmp_b = b

    result = 0
    for i in range(2):
        if tmp_a > tmp_b:
            result = result + tmp_a
            tmp_a = tmp_a - 1
        else:
            result = result + tmp_b
            tmp_b = tmp_b - 1

    return result


def main():
    

    print("%s" % solve(*parse_input()))

if __name__ == '__main__':

    main()

Solution (Python):
A,B=map(int,input().split())
ans=0
if A > B:
        ans += A
        A = A - 1
else:   
        ans += B
        B = B - 1
if A > B:
        ans += A
        A = A - 1
else:
        ans += B
        B = B - 1
print(ans)

Solution (Python):
l = map(int, raw_input().split());
ans = 0;

if (l[0] == l[1]):
	ans = l[0] + l[1];

elif(l[0] > l[1]):
	if (l[0] == 1):
		ans = l[0];
	else:
		ans = l[0] + l[0] - 1;

else:
	if (l[1] == 1):
		ans = l[1];
	else:
		ans = l[1] + l[1] - 1;

print ans;

Solution (Python):
A,B = (int(i) for i in input().split())
if A==B:
    print(A*2)
else:
    print(max(A,B)*2-1)

Solution (Python):
a,b=map(int,input().split());n=max(a,b);print(2*n-1 if abs(a-b)>0 else 2*n)

Solution (Python):
A, B = (int(i) for i in input().split())  
coin = 0

if A >= B + 2:
    coin = A + (A-1)
elif A + 2 <= B:
    coin = B + (B-1)
else:
    coin = A + B
    
print(coin)

Solution (Python):
from sys import stdin

def ria(sep = ''):
    if sep == '' :
        return list(map(int, input().split())) 
    else: return list(map(int, input().split(sep)))
def rsa(sep = ''):
    if sep == '' :
        return input().split() 
    else: return input().split(sep)
def ri(): return int(input())
def rd(): return float(input())
def rs(): return input()



A, B = map(int, input().split())
ans = 0
ans = max(ans, A + B)
ans = max(ans, A + A - 1)
ans = max(ans, B + B - 1)
print(ans)

Solution (Python):


alpha = list(map(int, input().split()))
sum = 0

for i in range(2):
  if alpha[0] > alpha[1]:
    sum += alpha[0]
    alpha[0] -= 1
  else:
    sum += alpha[1]
    alpha[1] -= 1
    
print(sum)

Solution (Python):
A, B = map(int, input().split())
if A > B:
    print(A+A-1)
elif A < B:
    print(B+B-1)
else:
    print(2*A)

Solution (Python):
i = list(map(int, input().split()))
if i[0]>i[1] and i[0]-i[1]>=2:
	print(2*(i[0])-1)
elif i[1]>i[0] and i[1]-i[0]>=2:
	print(2*(i[1])-1)
else:
	print(i[1]+i[0])

Solution (Python):
A,B=map(int,input().split())
if A<B:
    print(B+max(A,B-1))
elif A>B:
    print(A+max(A-1,B))
else:
    print(A+B)

Solution (Python):
A, B = map(int, input().strip().split(' '))

res = max([A, B])
if A >= B:
    A -= 1
else:
    B -= 1

res += max([A, B])
print(res)

Solution (Python):
x,y = map(int,input().split())

z = 0
if x > y:
    z+= x
    x -= 1
else:
    z+=y
    y -= 1
if x > y:
    z+= x
    x -= 1
else:
    z+=y
    y -= 1
print(z)

Solution (Python):


a, b = map(int, input().split())
x = 0

if(a >= b):
    x += a
    if((a-1)>=b):
        x += (a-1)
    else:
        x += b
else:
    x += b
    if(a>=(b-1)):
        x += a
    else:
        x += b-1

print(x)

Solution (Python):
inp = list(map(int, input().split()))
a = inp[0]
b = inp[1]

if a==b:
  print(a+b)

if a>b:
  print(2*a-1)

if a<b:
  print(2*b-1)

Solution (Python):
a,b = map(int,input().split())

if a == b:
  print(a+b)
else:
  print(max(a,b) * 2 - 1)

Solution (Python):


a = []

a = list(map(int, input().split()))

coin = 0
for i in range(2):
    if a[0] >= a[1]:
        coin += a[0]
        a[0] = a[0] - 1
    else:
        coin += a[1]
        a[1] = a[1] - 1

print(coin)

Solution (Python):
import sys

input = sys.stdin.readline
a, b = map(int, input().split())
cnt = 0
if a > b:
    cnt += a
    a -= 1
else:
    cnt += b
    b -= 1
cnt += max(a, b)
print(cnt)

Solution (Python):
a, b = [int(x) for x in input().split()]

score = 0

if a > b:
    score += a
    a -= 1
else:
    score += b
    b -= 1

if a > b:
    score += a
else:
    score += b

print(score)

Solution (Python):
a,b = map(int, raw_input().split())

if a == b:
 v = a + b
elif a > b:
 v = a * 2 -1
else:
 v = b * 2 -1

print v

Solution (Python):
inp = []
ii = input().split()
if int(ii[0]) > int(ii[1]):
    re = int(ii[0])  * 2 -1
elif int(ii[0]) < int(ii[1]):
    re = int(ii[1])  * 2 -1
else:
    re = int(ii[0])  * 2
print(re)

Solution (Python):
c=list(map(int, input().split()))
a=max(c)
b=min(c)
if a>b+1:
      print(2*a-1)
else:
      print(a+b)

Solution (Python):
a, b = map(int,input().split())
ans = 0

mn = max(a, b)
ans+=mn
if mn == a:
  a -= 1
else:
  b -= 1
mn = max(a, b)
ans += mn
print(ans)

Solution (Python):
A, B = map(int,input().split())
ans = max(A, B) + max((max(A, B)-1), min(A, B))
print(ans)

Solution (Python):
A,B = map(int,input().split())
print(max(A+B, A+A-1, B+B-1))

Solution (Python):
A, B = list(map(int,input().split()))
def button(A, B):
  if A > B:
    result = A
    return([A - 1, B, result])
  elif A == B:
    result = A
    return([A - 1, B, result])
  else:
    result = B
    return([A, B - 1, result])
 
A, B, result_1 = button(A, B)
A, B, result_2 = button(A, B)
 
print(result_1 + result_2)

Solution (Python):
s=list(map(int,input().split()))
a=s[0]
b=s[1]
cand = [2*a-1,a+b,2*b-1]
print(max(cand))

Solution (Python):
A,B=map(int,input().split())
if A == B :
    Answer = A + B
elif B+1 > A :
    Answer = B + B-1
else :
    Answer = A + A-1
        
print(Answer)