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-----
5 3

-----Sample Output-----
9

You can get 5 + 4 = 9 coins by pressing the button of size 5 twice, and this is the maximum result.

Difficulty: introductory

Starter code:

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

x,y = map(int,input().split())
print(max(x+y,x+(x-1),y+(y-1)))

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

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

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

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

if a > b or a < b:
    m = max(a, b)
    print(2 * m - 1)
elif a == b:
    print(a + b)

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

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

a=list(map(int,input().split()))
count=0
for v in range(2):
    if a[0]>=a[1]:
        count+=a[0]
        a[0]-=1
    else:
        count+=a[1]
        a[1]-=1
print(count)

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

A, B = map(int, input().split())
ans = 0
for _ in range(2):
    if A < B:
        ans += B
        B -= 1
    else:
        ans += A
        A -= 1
print(ans)

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

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

print(ans)


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

ans = 0
for _ in range(2):
    choice = max(a, b)
    ans += choice
    if choice == a:
        a -= 1
    else:
        b -= 1

print(ans)

A, B = list(map(int, input().split()))
ans = 0
for _ in range(2):
    ans += max(A, B)
    if A >= B:
        A -= 1
    else:
        B -=1
print(ans)


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

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

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

A,B = map(int,input().split())
if abs(A-B) == 0:
    ans = A + B
elif abs(A-B) == 1:
    ans = max(A,B) +min(A,B)
else:
    ans = max(A,B) + max(A,B) -1
print(ans)

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

A = a + b
B = a + a - 1
C = b + b - 1

L = [A, B, C]

print(max(L))

rStr = input()

A = int(rStr.split(' ')[0])
B = int(rStr.split(' ')[1])

result = 0
index = 0

while index < 2 :
    if A <= B :
        result += B
        B = B - 1
    else :
        result += A
        A = A - 1
    index = index + 1

print(result)

a,b=map(int,input().split(" "))
print(max(a,b)+max(max(a,b)-1,min(a,b)))

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

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

A,B=(int(x) for x in input().split())
if A > B:
    print(2 * A - 1)
elif A < B:
    print(2 * B - 1)
else:
    print(2 * A)

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

a,b=map(int,input().split())
print([a+b,2*max(a,b)-1][max(a,b)-1>=min(a,b)])

a=list(map(int,input().split()))
a.sort()
r=a[-1]
a[-1]-=1
a.sort()
r+=a[-1]
print(r)

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)

A,B=list(map(int,input().split()))
count=0
for i in range(0,2):
    if A==B:
        count=count+A
        
    elif A>B:
        count=count+A
        A=A-1
        
    elif A<B:
        count=count+B
        B=B-1
        
print(count)
        


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


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

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

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

AB = list(map(int, input().split()))
ans = 0

for i in range(2):
    ans += max(AB)
    AB[AB.index(max(AB))] -= 1

print(ans)

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

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


#if elseによる実装
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)

a,b = map(int,input().split())
#lis = list(map(int,input().split()))
count = 0
if a>b:
    count += a
    a -= 1
else:
    count += b
    b -= 1
if a>b:
    count += a
    a -= 1
else:
    count += b
    b -= 1
print(count)

# A Buttons
a, b = list(map(int, input().split()))
coin = 0
for i in range(2):
    if a > b:
        coin += a
        a = a - 1
    else:
        coin += b
        b = b - 1
print(coin)


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

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

a,b=list(map(int, input().split()))
ans=0
ans=max(a,b)
c=max(a,b)-1
ans+=max(min(a,b),c)
print(ans)


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

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

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

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

a,b = list(map(int,input().split()))
ans = max(a,b)
q = max(a,b)
d = min(a,b)
ans += max(q-1,d)

print(ans)


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

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

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

l=input().rstrip().lstrip().split(" ")
print(max(int(l[0]), int(l[1])) + max(min(int(l[0]), int(l[1])), max(int(l[0]), int(l[1])) - 1))

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

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

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

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

# 以下を出力する
# A > B => A + (A − 1)
# A < B => B + (B − 1)
# A = B => A + B
if A > B: print(2*A-1)
elif A == B: print(A+B)
else: print(2*B-1)

import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    A, B = list(map(int, readline().split()))

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

    return


def __starting_point():
    main()

__starting_point()

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

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

print(ans)

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

H,W=list(map(int,input().split()))
ans=0
for i in range(2):
   if H>=W:
      ans+=H
      H-=1
   else:
      ans+=W
      W-=1
print(ans)

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

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

print(res)


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

def count_coin_maximum():
    a_button, b_button = list(map(int, input().split()))
    if a_button == b_button:
        return a_button + a_button
    elif a_button > b_button:
        return a_button + max(a_button - 1, b_button)
    else:
        return b_button + max(b_button - 1, a_button)


print((count_coin_maximum()))


A,B = map(int,input().split())
count=0
for _ in range(2):
       if A>=B:count+=A;A-=1
       else :count+=B;B-=1
print(count)

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


a,b=map(int,input().split())
if a != b:
    button=max(a,b)
    all=0
    all += button*2 -1
    print(all)
else:
    print(a*2)

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

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

print(ans)

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

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


import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    A, B = list(map(int, readline().split()))

    vec = [A, B, A-1, B-1]
    vec.sort(reverse=True)

    print((sum(vec[:2])))

    return


def __starting_point():
    main()

__starting_point()

A, B = list(map(int, input().split()))
total = 0

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

print(total)


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

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)

#ABC124
a,b = map(int,input().split())
print(max(a+b,a+(a-1),b+(b-1)))

a,b = map(int, input().split())
if a<b:
    a,b = b,a

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

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

if a > b:
    c = c + a
    a = a - 1

elif a < b:
    c = c + b
    b = b - 1

else:
    c = c + a

if a > b:
    c = c + a
    a = a - 1

elif a < b:
    c = c + b
    b = b - 1

else:
    c = c + a

print(c)

a, b = list(map(int, input().split()))
if a == b:
    print((a+b))
else:
    print((max(a, b) + max(a, b) -1))


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


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

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


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

# coding: utf-8
# Your code here!
number = input().split(" ")
A = int(number[0])
B = int(number[1])

ans = 0

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

print(ans)

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

list=[a+b, 2*a-1, 2*b-1]

print(max(list))

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

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

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

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


print(max(a,b) + max(a,b) - 1 if abs(max(a,b) - min(a,b)) >= 2 else max(a,b) + min(a,b))

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

A,B=list(map(int,input().split()))
print((max(2*A-1,A+B,2*B-1)))


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

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


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

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


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

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

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

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

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

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

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

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

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

#s=int(input())
# b=input()
# c=[]
# for i in range(b):
#     c.append(a[i])
a = list(map(int,input().split()))
#b = list(map(int,input().split()))
c=0
for i in range(2):
    c+=a[a.index(max(a))]
    a[a.index(max(a))]=a[a.index(max(a))]-1

print(c)



a = list(map(int,input().split()))
ans = 0
if a[0]>a[1]:
  ans += a[0]
  a[0] -= 1
else:
  ans += a[1]
  a[1] -= 1
if a[0]>a[1]:
  ans += a[0]
else:
  ans += a[1]
print(ans)



a,b=input().split()
a=int(a)
b=int(b)
if a-b>=2:
  print(2*a-1)
if b-a>=2:
  print(2*b-1)
if -2<a-b<2:
  print(a+b)

A, B = map(int,input().split())
if A != B:
    x = max(A, B)
    ans = 2 * x - 1
else:
    ans = 2 * A
print(ans)

A,B=map(int,input().split())
coin_list=[]

COIN1=A+A-1
COIN2=B+B-1
COIN3=A+B

coin_list.append(COIN1)
coin_list.append(COIN2)
coin_list.append(COIN3)

print(max(coin_list))

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

def mapt(fn, *args):
    return tuple(map(fn, *args))


def Input():
    return mapt(int, input().split(" "))


def main():
    a, b = Input()
    c1 = a + b
    c2 = a + a -1
    c3 = b + b -1
    print(max(c1, c2, c3))



main()

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