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



Sample input:
5 3


Sample output:
9

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
l=list(map(int,input().split()))

print(max(sum(l),max(l)*2-1))

Submission status: Accepted

Solution code:
buttons = list(map(int,input().split()))
ans=0
for i in range(2):
  buttons.sort()
  ans+=buttons[-1]
  buttons[-1]-=1
print(ans)

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A,B=[int(x) for x in input().split()]

ans=0

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

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

X = [A,B,A-1,B-1]

X = sorted(X)
print(X[-1] + X[-2])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B = [int(x) for x in input().split()]
print(sum(sorted([A, B, A-1, B-1])[-2:]))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a_L = list(map(int,input().split()))
ans = 0
for val in range(2):
    a_L.sort(reverse=True)
    ans += a_L[0]
    a_L[0] -=1
print(ans)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b = list(map(int,input().strip().split()))
a1 = a + a - 1
a2 = a + b
a3 = b + b - 1
s = [a1,a2,a3]
print(max(s))

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
s = [a,b]
if a!=b:
  print(max(s)*2-1)
else:
  print(max(s)*2)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def slove():
    import sys
    input = sys.stdin.readline
    a, b = list(map(int, input().rstrip('\n').split()))
    if a == b:
        print(a + b)
    elif a > b:
        print(a + (a - 1))
    elif a < b:
        print(b + (b - 1))


if __name__ == '__main__':
    slove()

Submission status: Accepted

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

Submission status: Accepted

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

lista=[]

lista.append(b)
lista.append(b-1)
lista.append(a)
lista.append(a-1)

lista.sort()
#print(lista)
print(lista[-1]+lista[-2])

Submission status: Accepted

Solution code:
A,B = (int(x) for x in input().split())

sum = 0
if(A < B):
	sum += B
	B-=1
else:
	sum += A
	A-=1
    
if(A < B):
	sum += B
	B-=1
else:
	sum += A
	A-=1

print (sum)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = list(map(int, input().split()))

n.sort()
coin = 0

for i in range(0, 2) :
    coin += n[1]
    n[1] -= 1
    n.sort()

print(coin)

Submission status: Accepted

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

Submission status: Accepted

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

gain = 0

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

print(gain)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
INPUT = list(map(int,input().split()))
A=int(INPUT[0])
B=int(INPUT[1])
coin=0

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

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

print(coin)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A,B = map(int,input().split())
target = list(range(1,A+1))
target.extend(list(range(1,B+1)))

target.sort(reverse=True)
print(target[0]+target[1])

Submission status: Accepted

Solution code:
'''A - Buttons
https://atcoder.jp/contests/abc124/tasks/abc124_a

>>> main(5,3)
9
>>> main(3,4)
7
>>> main(6,6)
12'''


def main(a, b):
    _max = max(a, b)
    _min = min(a, b)
    amount = 0

    amount += _max
    _max -= 1

    if _max > _min:
        amount += _max
    else:
        amount += _min

    print(amount)


if __name__ == "__main__":
    a, b = map(int, input().split(' '))

    main(a, b)

Submission status: Accepted

Solution code:
a, b = (int(x) for x in input().split())
if a > b:
    c = b
    b = a
    a = c
if b - a >= 1: print(2*b - 1)
elif b == a: print(2 * a)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b = (int(x) for x in input().split())

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

Submission status: Accepted

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

total = max(a, b)
if total == a:
    total += max(a-1, b)
else:
    total += max(a, b-1)

print(total)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A,B = map(int,input().split())
ans_list = sorted([A,A-1,B,B-1])
print(sum(ans_list[-2:]))

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
a = sorted([A,A-1,B,B-1])
print(a[-1]+a[-2])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def slove():
    import sys
    import heapq
    input = sys.stdin.readline
    ab = [-i for i in list(map(int, input().rstrip('\n').split()))]
    heapq.heapify(ab)
    t = 0
    for i in range(2):
        p = heapq.heappop(ab)
        t -= p
        heapq.heappush(ab, p + 1)
    print(t)


if __name__ == '__main__':
    slove()

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
r = 0
mx = max(a, b)
r += mx
mn = min(a, b)
mx -= 1
r += max(mx, mn)
print(r)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
ab=[a,(a-1),b,(b-1)]
ab.sort()
print(ab[2]+ab[3])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#2019/09/26
A, B = map(int, input().split())
print(A + max(A-1, B) if max(A,B) == A else B + max(A, B-1))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
A,B=[int(s) for s in input().split()]
if A>B:
  print(2*A-1)
elif A==B:
  print(2*A)
else:
  print(2*B-1)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

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

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

ans += max(a, b)

print (ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

ans = 0

lis = [A+A-1,A+B,B+B-1]

print(max(lis))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
from io import StringIO
import unittest

class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)
    def test_入力例_1(self):
        input = """5 3"""
        output = """9"""
        self.assertIO(input, output)
    def test_入力例_2(self):
        input = """3 4"""
        output = """7"""
        self.assertIO(input, output)
    def test_入力例_3(self):
        input = """6 6"""
        output = """12"""
        self.assertIO(input, output)

def resolve():
    X=[int(i) for i in input().split()]
    m=max(X)
    
    print(2*m if X[0]==X[1] else 2*m-1)


if __name__ == "__main__":
    resolve()

Submission status: Accepted

Solution code:
def f_a():
    a, b = map(int, input().split())
    if a>b:
        o = a+max(a-1, b)
    else:
        o = b+max(a, b-1)
    print(o)

if __name__ == "__main__":
    f_a()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
button = list(map(int, input().split()))

ans = 0
for _ in range(2):
    ans += max(button)
    button[max(range(len(button)), key=lambda i:button[i])] -= 1

print(ans)

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
M1,m1=max(a,b),min(a,b)
c=M1-1
M2=max(c,m1)
print(M1+M2)

Submission status: Accepted

Solution code:
bt = input()
bt_A, bt_B = bt.split()
bt_max, bt_min = max(int(bt_A), int(bt_B)), min(int(bt_A), int(bt_B))
max_num = bt_max + max(bt_max - 1, bt_min)
print(max_num)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

coin = 0

#1
if a > b:
  coin += a
  a -= 1
else:
  coin += b
  b -= 1
#2 
if a > b:
  coin += a
else:
  coin += b

print(coin)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

C = 0

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

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

if B == A:
   C = B+A
   print(C)

Submission status: Accepted

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

total = 0

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(max(A,B))

Submission status: Accepted

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

Submission status: Accepted

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

ans_1 = A + B
ans_2 = 2 * A - 1
ans_3 = 2 * B - 1
ans = max(ans_1, ans_2, ans_3)
print(ans)

Submission status: Accepted

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

print(coin)

Submission status: Accepted

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

sum_coin = 0
tmp = max(A, B)
sum_coin += tmp
if tmp == A:
    A += -1
else:
    B += -1
tmp = max(A, B)
sum_coin += tmp
print(sum_coin)

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

if ( A > B ):
  x += A
else:
  x += B

print ( x )

Submission status: Accepted

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#15:14
a = list(map(int,input().split()))
a.sort()
if a[0] == a[1]:
  print(2 * a[1])
else:
  print(2 * a[1] - 1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b = map(int, input().split())
if abs(a-b) >= 2:
    print(max([a,b]) + max([a,b]) -1)
else:
    print(max([a,b]) + min([a,b]))

Submission status: Accepted

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

Submission status: Accepted

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

x = 0

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


print(x)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
a, b = map(int, input().split())
if a == b:
    print(a*2)
else:
    print(max(a, b) + (max(a,b) - 1))

Submission status: Accepted

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

Submission status: Accepted

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

if A<B:
  c=B
  B=B-1
else:
  c=A
  A=A-1
if A<B:
  d=B
else:
  d=A
print(c+d)

Submission status: Accepted

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

cnt = 0

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

print(cnt)

Submission status: Accepted

Solution code:
M,N = [int(x) for x in input().split()]
print(M+N if M==N else 2*max(M,N)-1)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

r = 0
for i in range(2):
	s.sort()
	s.reverse()
	r += s[0]
	s[0] -= 1

print (r)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x, y = map(int,input().split())
if x==y:
  print(2*x)
else:
  print(2*max(x,y)-1)

Submission status: Accepted

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

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

B=[x+(x-1) for x in A ]

sum=A[0]+A[1]
num=max(B)

if num > sum:
    print(num)    
else:
    print(sum)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

c=0

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = sorted(map(int,input().split()))
print(max(2 * a[1] - 1, a[0] + a[1]))

Submission status: Accepted

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

Submission status: Accepted

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

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

if A > B:
  sum += A
else:
  sum += B

print(sum)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
c, d = a-1, b-1
l = sorted([a,b,c,d])[::-1]
print(l[0]+l[1])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A = list(map(int, input().split()))
if A[0] == A[1]:
  print(2*max(A))
  exit()
print(2*max(A)-1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = list(map(int,input().split()))
a.sort()
res = a[1]
a[1] = a[1]-1
a.sort()
res += a[1]
print(res)

Submission status: Accepted

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

l = sorted([a,b,a-1,b-1],reverse = True)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*-coding: utf-8 -*-
A, B = map(int, input().split())
if A > B:
    print(2 * A - 1)
elif B > A:
    print(2 * B - 1)
else:
    print(2*A)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
s=list(input().split())
a=int(s[0])
b=int(s[1])
count=0
button=0
while(button<2):
  if a>=b:
    count+=a
    a-=1
  else:
    count+=b
    b-=1
  button+=1

print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    A, B = 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)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    a, b = map(int, input().split())
    
    ans = 0
    if a != b:
        ans = max(a, b) * 2 - 1
    else:
        ans = a + b
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
x= [ int(x) for x in input().split()]

a,b=x[0],x[1]

y = (max(a,b))

resultado1 = (y*2)-1
resultado2 = a+b

print(max(resultado1,resultado2))

Submission status: Accepted

Solution code:
x = input().split()
A = int(x[0])
B = int(x[1])
if (A > B):
  print((A*2) - 1)
elif (A == B):
  print(A * 2)
else:
  print((B*2) - 1)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

lst = [a,a-1,b,b-1]
lst = sorted(lst, reverse=True)
print(lst[0]+lst[1])

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
A, B = map(int, input().split())
ans = 2*A-1
if ans < 2*B-1:
	ans = 2*B -1
if ans < A + B:
	ans = A + B

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
x = max(a, b)
y = max(x - 1, min(a, b))
print(x + y)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
print(sum(sorted([A, A-1, B, B-1])[2:]))

Submission status: Accepted

Solution code:
# Buttons
# input
A, B = map(int, input().split())

# solution
res = max([A*2-1, A+B, B*2-1])

#output
print(res)