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())
sum = 0
for x in range(2):
    if A >=B:
        sum += A
        A -= 1
    else:
        sum += B
        B -= 1
print(sum)

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

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()) 
C=0
if A >= B+1 :
	C=2*A-1
	print( '%d' % C  )
elif B >= A+1 :
	C=2*B-1
	print( '%d' % C )
else:
	C=2*A
	print( '%d'% C)

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

x1 = max(a, b)

if x1 == a:
  a = a-1
  x2 = max(a, b)
  print(x1+x2)
elif x1 == b:
  b = b-1
  x2 = max(a, b)
  print(x1+x2)

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

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

first=max(A,B)
dammy=min(A,B)
second=max(first-1,dammy)

out=first+second
print(out)

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 = map(int, input().split())
if a < b:
  a, b = b, a

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

Solution (Python):
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b



def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)



def lcm(a, b):
    g = gcd(a, b)
    return a / g * b


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



if __name__ == '__main__':
    main()

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

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

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

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

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

Solution (Python):
a = [int(num) for num in input().split()]
a.sort(reverse=True)

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

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

print(ans)

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

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

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

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

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

Solution (Python):
switch_s = input().split()

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

combine = [a + a - 1, a + b, b + b - 1]

print(max(combine))

Solution (Python):
a,b=[int(i) for i in input().split()]
print(max([2*a-1,a+b,2*b-1]))

Solution (Python):
button = input().split()
A = button[0]
B = button[1]
full = []
A = int(A)
B = int(B)
if A >=3 and B <= 20:
    if A + A -1 >= A + B and A + A -1 >= B + B -1:
        full.append(A + A -1)
    elif A + B >= A + A -1 and A + B >= B + B -1 :
        full.append(A + B)
    else:
        full.append(B + B - 1)
else:
    full.append(0)
print(max(full))

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


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

elif A == B:
    print(A + B)

else:
    print(B + B -1)

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

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

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

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

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

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

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


print(num)

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

list = [A+B, 2*A-1, 2*B-1]
print(max(list))

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

coin = 0

if a == b:
    coin = a * 2
elif abs(a - b) == 1:
    coin = a + b
elif a - b >= 2:
    coin = a + (a - 1)
elif a - b <= -2:
    coin = b + (b - 1)

print(coin)

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

coin = 0

if a == b:
    coin = a * 2
elif abs(a - b) == 1:
    coin = a + b
elif a - b >= 2:
    coin = a + (a - 1)
elif a - b <= -2:
    coin = b + (b - 1)

print(coin)

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

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

print(ans)

Solution (Python):
button = input().split()
a_button = int(button[0])
b_button = int(button[1])
sum = 0

for i in range(0, 2):
    if(a_button >= b_button):
        sum += a_button
        a_button -= 1

    elif(b_button > a_button):
        sum += b_button
        b_button -= 1

print(sum)

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

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

Solution (Python):
l = list(map(int, input().split()))
coin_sum = 0

if(abs(l[0]-l[1])>0):
  coin_sum = 2 * max(l[0],l[1]) - 1
else:
  coin_sum = 2 * max(l[0],l[1])

print(coin_sum)

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

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

Solution (Python):
input1 = input().split()

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

total = 0

for c in range(2, 0, -1):
    if a >= b:
        total += a
        a -= 1
    else:
        total += b
        b -= 1

print(total)

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())
if a == b:
  print(2*a)
else:
  print(2*max(a,b)-1)

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

    coin = 0;
    if a == b:
        print(a * 2)
    elif a < b:
        coin += b + max(a, b-1)
        print(coin)
    else:
        coin += a + max(a-1, b)
        print(coin)


if __name__ == "__main__":
  main()

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

Solution (Python):
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)

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

A, B = LI()

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

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

if a==b:
    x=a*2;

else:
     x=max(a, b)*2-1

print(x)

Solution (Python):
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)

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 a==b:
    print(a*2)
else:
    print(max(a,b)*2-1)

Solution (Python):
a, b = map(int,input().split())
n_list = [a,b]
n_list.sort()
sum = 0
for i in range(2):
    sum = sum + n_list[1]
    n_list[1] = n_list[1]-1
    n_list.sort()
print(sum)

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

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=map(int,input().split())
count=0
c=0
while c<2:
    if a>=b:
        count+=a
        a-=1
    elif b>a:
        count+=b
        b-=1
    c+=1
print(count)

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



coins = 0

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

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

print(coins)

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

Solution (Python):

a, b = input().split()
a, b = int(a), int(b)
total = 0
if a > b :
  total = 2*a -1 

if b > a:
  total = 2*b-1


  
if a == b:
  total = 2*a

print(total)

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

Solution (Python):
a, b= [int(x) for x in input().split()]
print(max(a+b, max(a+a-1, b+b-1)))

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

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

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

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

print(coins)

Solution (Python):
def sub():
    A, B = [int(e) for e in input().split(" ")]
    N = 0
    for _ in range(2):
        if A > B:
            N = N + A
            A = A -1
        else:
            N = N + B
            B = B - 1
    print("{}".format(N))

sub()

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

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

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

Solution (Python):
from sys import stdin

def solve(nums):
    a, b = nums
    p = 0
    for i in range(2):
        if a < b:
            p = p + b
            b = b - 1
        else:
            p = p + a
            a = a - 1
    return p


def main():
    nums = [int(n) for n in stdin.readlines()[0].split(' ')]
    p = solve(nums)
    print(p)

if __name__ == '__main__':
    main()

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

Solution (Python):
m = [ int(s) for s in input().split(" ") ]
x = 0

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

print(x)

Solution (Python):
def solve(a, b):
  return max(a*2-1, a+b, b*2-1)

def main():
  a, b = map(int, input().split())
  
  ans = solve(a, b)
  print(ans)

main()

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 = list(map(int, input().split()))
b = max(a[0],a[1])
c = min(a[0],a[1])
d = max(b-1, c)
print(b+d)

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

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

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

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

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

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

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

Solution (Python):


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

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

Solution (Python):
args = input()
args = args.split(' ')

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

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

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

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

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

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

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

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

max_number = max(A,B)
min_number = min(A,B)

print(max_number+max(max_number-1,min_number))

Solution (Python):
import sys



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

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

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())
sum = 0

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

print(sum)

Solution (Python):
def main():
    a, b = [int(i) for i in input().split()]
    ans = max(a,b)
    ans += max(max(a,b)-1, min(a,b))
    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):



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


max_coin = 0

for _ in range(2):
    if buttons[0] > buttons[1]:
        max_coin += buttons[0]
        buttons[0] -= 1
    else:
        max_coin += buttons[1]
        buttons[1] -= 1


print(max_coin)

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

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

if A > B:
    ans = A + (A - 1)
elif A == B:
    ans = A + B
elif A < B:
    ans = B + (B - 1)

print(ans)

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

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

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

if (a[0] == a[1]):
  print(a[0]*2)
else:
  bigger = max(a[0], a[1])
  print(2 * bigger -1)

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

slice = sorted([A, A-1, B, B-1])[-2:]
print(sum(slice))

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

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

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

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

print(rslt)

Solution (Python):

l = list(map(int, input().split(' ')))
A = l[0]
B = l[1]
ans = 0

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

print(ans)

Solution (Python):
if __name__ == '__main__':                                                                                                                                   
    A,B = list(map(int,input().split()))                                                                                                                     
    N = 2                                                                                                                                                    
                                                                                                                                                             
    a,b = A,B                                                                                                                                                
                                                                                                                                                             
    res = 0                                                                                                                                                  
    for x in range(N):                                                                                                                                       
        if a>b:                                                                                                                                              
            res = a+res                                                                                                                                      
            a = a-1                                                                                                                                          
        else:                                                                                                                                                
            res = b+res                                                                                                                                      
            b = b-1                                                                                                                                          
                                                                                                                                                             
    print(res)

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

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

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

if p1 > a + b:
    print p1
else:
    print a+b

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

Solution (Python):
a = map(int,input().split())
a = list(a)
k = 0
for i in range(2):
    if a[0] > a[1]:
        k += a[0]
        a[0] += -1
    elif a[0] < a[1]:
        k += a[1]
        a[1] += -1
    else:
        k += a[0]
        a[0] += -1
print(k)

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

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

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

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

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

for i in range(n):
  if a > b:
    x += a
    a -= 1
  else:
    x += b
    b -= 1
    
print(x)

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

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

Solution (Python):
import sys


def input():
    return sys.stdin.readline()[:-1]








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

Solution (Python):

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

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

print(sum)

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

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

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


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

print(count)

Solution (Python):


''' 
------------------------
author : iiou16
------------------------
'''

def main():
    buttons = list(map(int, input().split()))
    coin = 0

    max_index = buttons.index(max(buttons))
    coin += max(buttons)
    buttons[max_index] -= 1
    coin += max(buttons)

    print(coin)


if __name__ == '__main__':
    main()

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

ans = max(a, b)
ans += max(ans-1, min(a, b))
print(ans)

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

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

Solution (Python):
a, b = map(int, input().split())
print(sum(sorted([a, b, a-1, b-1], reverse=True)[0:2]))

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

Solution (Python):
A,B = map(int,input().split())
A_A = A + A - 1
A_B = A + B
B_B = B + B - 1
list = [A_B, A_A, B_B]
list.sort(reverse=True)
print(list[0])

Solution (Python):
A,B = map(int,input().split())
A_A = A + A - 1
A_B = A + B
B_B = B + B - 1
list = [A_B, A_A, B_B]
list.sort(reverse=True)
print(list[0])

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
else:
    res += B

print(res)

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

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

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):
A,B = input().split()
A= int(A)
B= int(B)
coin = 0
for i in range (2):
  if A>B:
    coin += A
    A-=1
  else:
    coin += B
    B-=1
    
print(coin)

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

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

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

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

Solution (Python):
inputs = list(map(int, input().split()))
max = []

if inputs[0] > inputs[1]:
    max.append(inputs[0])
    inputs[0] = inputs[0] - 1
else:
    max.append(inputs[1])
    inputs[1] = inputs[1] - 1

if inputs[0] > inputs[1]:
    max.append(inputs[0])
    inputs[0] = inputs[0] - 1
else:
    max.append(inputs[1])
    inputs[1] = inputs[1] - 1

print(max[0]+max[1])

Solution (Python):

"""
A - Buttons
https://atcoder.jp/contests/abc124/tasks/abc124_a

"""
import sys


def solve(A, B):
    return max(A+B, A+A-1, B+B-1)


def main(args):
    A, B = map(int, input().split())
    ans = solve(A, B)
    print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])

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())
if a==b:
  print(2*a)
else:
  if a<b:
    print(b+(b-1))
  else:
    print(a+(a-1))

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

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

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

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

print(coins)

Solution (Python):
from sys import stdin


def main():
    A, B = [int(x) for x in stdin.readline().rstrip().split()]
    max_ = max(A, B)
    print(A * 2 if A == B else max_ * 2 - 1)


if __name__ == "__main__":
    main()

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

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

Solution (Python):

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

large_1=max(A,B)
small_1=min(A,B)
a = large_1-1

large_2 = max(a,small_1)

print(large_1+large_2)

Solution (Python):
A,B = map(int , input().split())
ans =0
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())
print(max(a,b)+max(max(a,b)-1,min(a,b)))

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

Solution (Python):
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)

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

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

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

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

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

Solution (Python):
b, c = map(int, input().split())
total = 0;
if(b > c):
    total = b
    b -= 1
else:
    total = c
    c -= 1

if(b > c):
    total += b
    b -= 1
else:
    total += c
    c -= 1

print(total)

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

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

Solution (Python):
import numpy as np
a,b=map(int, input().split())

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

Solution (Python):
def solve():
    A, B = [int(_) for _ in raw_input().split()]
    ret = max(2*A - 1, A + B, 2*B-1)
    print str(ret)

if __name__ == '__main__':
    solve()

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

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

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

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

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

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

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

Solution (Python):

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

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

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

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

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

print(ans)

Solution (Python):
A, B = map(int, input().split())
nums = [A, B]
nums.sort()
ans = 0
cnt = 0
while cnt < 2:
    ans += nums[-1]
    nums[-1] -= 1
    nums.sort()
    cnt += 1
print(ans)

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

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(2*A-1)
if A<B:
  print(2*B-1)
if A==B:
  print(A+B)

Solution (Python):
A,B=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)

Solution (Python):


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

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

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

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

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

s_1 = sorted(s)
s_2 = sorted([s_1[0], s_1[1]-1])
A = s_1[1] + s_2[1]
 
print(A)

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

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

A=int(A)
B=int(B)
X=A+A-1
Y=B+B-1
Z=A+B
print(max(X,Y,Z))

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

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

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

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

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())
c = max(a,b)
if c-1 >= min(a,b):
    print(2 * c - 1)
else:
    print(a + b)

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

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):
a,b=map(int,input().split())
 
print(max(2*a-1,2*b-1,a+b))

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):
a,b = map(int,input().split())
l = [a,a-1,b,b-1]
l = sorted(l)
print(sum(l[-2:]))

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

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

print(point)

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

Solution (Python):


def main(A, B):
    if(A<=B-1):
        print(2*B-1)
    elif(A==B):
        print(2*B)
    else:
        print(2*A-1)
            

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