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:
arr = input().split(" ")
i1 = int(arr[0])
i2 = int(arr[1])
if i1 == i2:
  print(i1 * 2)
else:
  m = max(i1, i2)
  print(m + m - 1)

Submission status: Accepted

Solution code:
# スペース区切りの整数の入力
a, b = map(int, input().split())
# 文字列の入力
s = [2*a-1, 2*b-1, a+b]
# 出力
print("{}".format(max(s)))

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-1 if a!=b else a+b)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
k = input().split()
a = int(k[0])
b = int(k[1])
s = 0
if(a>=b):
    s+=a
    a-=1
else:
    s+=b
    b-=1
print(s+max(a,b))

Submission status: Accepted

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

if a > b :
    r += a + a-1
elif b > a:
    r += b + b-1
else:
    r += a + b

print(r)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def button(A, B):
  bigger = max([A, B])
  if A == bigger:
    print(bigger + max([A-1, B]))
  else:
    print(bigger + max([A, B-1]))

num = input().strip().split()
button(int(num[0]), int(num[1]))

Submission status: Accepted

Solution code:
n = input()
x,y = n.split(" ")
x = int(x)
y = int(y)
out = 0

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

print(out)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

ans = max(A, B)

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

ans += max(A, B)

print(ans)

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

Submission status: Accepted

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


if A > B:
    num = ((A*2) - 1)


elif A < B:
    num = ((B*2) - 1)

else:
    num = A + B


print(num)

Submission status: Accepted

Solution code:
res = 0
tmp = raw_input().split()
a = int(tmp[0])
b = int(tmp[1])
l = max(a, b)
s = min(a, b)
res = res + l
res = res + max(l-1, s)
print(res)

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())

S1 = A + B
S2 = A + A - 1
S3 = B + B - 1

print(max(S1, S2, S3))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
AB = list(map(int,input().split()))
m2 = 2*max(AB)-1
two = sum(AB)
if m2>=two:
    print(m2)
else:
    print(two)

Submission status: Accepted

Solution code:
size_a, size_b = list(map(int, input().split()))
result = 0
if size_a > size_b:
  result += size_a
  size_a -= 1
else:
  result += size_b
  size_b -= 1
result += max(size_a, size_b)
print(result)

Submission status: Accepted

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

a = A*2-1
b = B*2-1
c = A+B

print(max(a,b,c))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b = [int(x) for x in 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())

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


# 出力
print("{}".format(C))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
inp = list(map(int, input().split()))
lst = []
for i in inp:
    for t in range(2):
        lst.append(i-t)
lst.sort()
lst.reverse()
print(lst[0]+lst[1])

Submission status: Accepted

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

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

Submission status: Accepted

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

button = [int(s) for s in input().split()]

a = max(button)
button[button.index(a)] -= 1
a += max(button)

print(a)

Submission status: Accepted

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

button = [int(s) for s in input().split()]

a = max(button)
button[button.index(a)] -= 1
a += max(button)

print(a)

Submission status: Accepted

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

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

print(s)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
b=input().split(" ")
a=[]
for i in b:
  a+=[int(i)]
ans=0
if a[1]-a[0]>=1:
  ans+=a[1]*2-1
elif a[0]-a[1]>=1:
  ans+=a[0]*2-1
else:
  ans+=a[0]+a[1]
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

a, b =  map(int, input().split())
#print("{} {}".format(a, b))
point = 0
for i in range(2):
    if a >= b:
        point += a
        a -= 1
    else:
        point += b
        b -= 1
print(point)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

if a > b: 
  print('{}'.format(a + a - 1))
elif a == b: 
  print('{}'.format(a + a))
else:
  print('{}'.format(b + b - 1))

Submission status: Accepted

Solution code:
a_bt, b_bt = map(int, input().split())
result = a_bt > b_bt
sum = a_bt if result else b_bt
a_bt = a_bt - 1 if result else a_bt
b_bt = b_bt - 1 if not result else b_bt
result = a_bt > b_bt
sum += a_bt if result else b_bt

print(sum)

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

sum = 0
sum = max(sum, A + A -1)
sum = max(sum, A + B)
sum = max(sum, B + B -1)

print(sum)

Submission status: Accepted

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

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

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

print(sum)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(sum_num)

Submission status: Accepted

Solution code:
import sys

def main():
    input = sys.stdin.readline
    A, B = map(int, input().split())
    
    ans = 0
    
    if A > B:
        ans = A + A - 1
    elif A == B:
        ans = A + B
    else:
        ans = B + B - 1
    
    print(ans)
   
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
input_arr = input().split()
button_nums = []

for i in input_arr:
    button_nums.append(int(i))

results = []

results.append(button_nums[0] + (button_nums[0] - 1))
results.append(button_nums[1] + (button_nums[1] - 1))
results.append(button_nums[0] + button_nums[1])

print(max(results))

Submission status: Accepted

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

total = 0

i = 0

while i < 2:
    if a >= b:
        total += a
        a -= 1
    else:
        total += b
        b -= 1
    
    i += 1

print(total)

Submission status: Accepted

Solution code:
from sys import stdin

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

c = [(A,B),(A,A-1),(B,B-1)]

print(max([sum(x) for x in c]))

Submission status: Accepted

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

for i in range (2):
    point += max(button)
    if button[0] >= button[1]:
        button[0] -= 1
    else:
        button[1] -= 1

print(point)

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())


result = 0

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

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

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 = (int(x) for x in input().split())

coins = max(a,b)

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

coins += max(a,b)

print(coins)

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:
X = [int(x) for x in input().split()]
X.append(X[0] - 1)
X.append(X[1] - 1)
X.sort()
print(X[-1] + X[-2])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

if A < B:
    x = B
    y = A
else:
    x = A
    y = B

if x - y >= 2:
    print(2*x-1)
else:
    print(x+y)

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())

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

Submission status: Accepted

Solution code:
X,Y=map(int,input().split())

sum=0
if (X>Y):
    sum+=X
    X-=1
else:
    sum+=Y
    Y-=1
if (X > Y):
    sum += X
    X -= 1
else:
    sum += Y
    Y -= 1

print(sum)

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

Submission status: Accepted

Solution code:
a,b=input().split()
c=int(a)
d=int(b)
c>=3
d<=20
print(max([c+d,c+(c-1),d+(d-1)]))

Submission status: Accepted

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

Submission status: Accepted

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

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

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:
_input = list(map(int, input().split()))
results = []
for i in range(2):
    if _input[0] > _input[1] or _input[0] == _input[1]:
        results.append(_input[0])
        if _input[0] > 3:
            _input[0] -= 1
    elif _input[0] < _input[1]:
        results.append(_input[1])
        if _input[1] > 3:
            _input[1] -= 1


print(sum(results))

Submission status: Accepted

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

Submission status: Accepted

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

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().rstrip().split())
if A == B:
    print(A + A)
else:
    print(max(A,B) + (max(A,B) - 1))

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

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())
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 = input().split()

c= int(a)+int(b)
d= int(a)-1 + int(a)
e =int(b)-1 + int(b)

if c > d:
    if c > e:
        print(c)
    else:
        print(e)
else:
    if d > e:
        print(d)
    else:
        print(e)

Submission status: Accepted

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

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

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())
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())

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

Submission status: Accepted

Solution code:
nm = [int(n) for n in input().split()];nm.extend([n-1 for n in nm]);nm.sort();nm.reverse();print(sum(nm[:2]));

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:
#!/usr/bin/env python
# -*- coding: utf-8 -*-


def main():
    x, y = list(map(int, input().split()))

    total = 0

    for _ in range(2):
        if x < y:
            total += y
            y -= 1
        else:
            total += x
            x -= 1

    print(total)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
inpt=input()
ABlist=inpt.split()
A=int(ABlist[0])
B=int(ABlist[1])
if A>B:
    Ans=A+A-1
elif A==B:
    Ans=A+B
else:
    Ans=B+B-1
print(Ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
data = list(map(int, input().split()))
if max(data)-1>min(data):
    x = max(data)-1
else:
    x = min(data)
sum = max(data)+x
print(sum)

Submission status: Accepted

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

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

Submission status: Accepted

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

a=button[0]
b=button[1]

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
button = list(map(int, input().split()))
if button[0] > button[1] :
  print("{}".format(button[0]*2-1))
elif button[0] < button[1] :
  print('{}'.format(button[1]*2-1))
else:
  print('{}'.format(button[0]*2))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
 # A - Buttons
a, b = list(map(int, input().split()))
first = max(a, b)
if a == first:
	a -= 1
else:
 	b -= 1
second = max(a, b)
print(first + second)

Submission status: Accepted

Solution code:

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

#判定
max_value=0
if A!=B:
    lerger=max(A,B)
    max_value=lerger+(lerger-1)

else:
    max_value=A+A


print('{}'.format(max_value))

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:
line = input()
lines = line.split()
a = int(lines[0])
b = int(lines[1])
res = 0
if a > b:
  res = a + a - 1
elif b > a:
  res = b + b - 1
else:
  res = a + b

print(res)

Submission status: Accepted

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

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 = input().split()
A = int(A)
B = int(B)
AA = A * 2 - 1
AB = A + B
BB = B * 2 - 1

print(max(AA, AB, BB))

Submission status: Accepted

Solution code:
button_size = list(map(int, input().split(" ")))
diff = button_size[0] - button_size[1]
if diff >= 2:
    print(button_size[0]*2 - 1)
    exit()
if diff > -2:
    print(button_size[0] + button_size[1])
    exit()
print(button_size[1]*2 -1)

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())
s=0
if A > B:
    s=A+(A-1)
elif A < B:
    s=B+(B-1)
else:
    s=A+B
print(s)

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

Submission status: Accepted

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

ans = 0
for i in range(2):
    ans += max(ab)
    tmp = ab.index(max(ab)) 
    ab[tmp] -= 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())
print(max(A + (A - 1), B + (B - 1), A + B))

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a=list(input().split())
b=int(a[0])
c=int(a[1])
if b>c:
  print(b+(b-1))
elif c>b:
  print(c+(c-1))
elif b==c:
  print(2*b)

Submission status: Accepted

Solution code:

# スペース区切りの整数の入力
a, b = map(int, input().split())
result = 0
for i in range(0,2):
    if a > b:
        result += a
        a -= 1
    else:
        result += b
        b -= 1

print(result)

Submission status: Accepted

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

X = [a, a-1, b, b-1]
X.sort()

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

Submission status: Accepted

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


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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
num = [0,0]

num[0], num[1] = map(int,input().split())

if num[0] == num[1]:
    point = num[0]*2
else:
    point = max(num)*2 - 1

print(point)

Submission status: Accepted

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

total = 0

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

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

print(total)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
inp=[i.strip() for i in sys.stdin.readlines()]
if len(inp)==1:
    if len(inp[0].split())==2:
        A,B=map(int,inp[0].split())
        print(max(2*A-1,2*B-1,A+B))
    else:
        S=inp[0]
        N=len(S)
        X=""
        Y=""
        for i in range(N):
            if i%2==0:
                X=X+"0"
                Y=Y+"1"
            else:
                X=X+"1"
                Y=Y+"0"
        A=0
        B=0
        for i in range(N):
            if X[i]!=S[i]:
                A+=1
            if Y[i]!=S[i]:
                B+=1
        print(min(A,B))
else:
    if len(inp[0].split())==1:
        N=int(inp[0])
        H=[int(i) for i in inp[1].split()]
        ans=1
        for i in range(1,N):
            flag=1
            for j in range(i):
                if H[j]>H[i]:
                    flag=0
                    break
            if flag==1:
                ans+=1
        print(ans)
    else:
        N,K=map(int,inp[0].split())
        S=inp[1]
        L=[0]
        tmp="1"
        for i in range(N):
            if tmp!=S[i]:
                L.append(1)
            else:
                L[-1]+=1
            tmp=S[i]
        if tmp=="0":
            L.append(0)
        M=len(L)
        if M<=2*K+1:
            print(N)
            exit()
        X=[0 for i in range(M+1)]
        for i in range(M):
            X[i+1]=L[i]+X[i]
        ans=0
        for i in range(0,M-2*K,2):
            ans=max(ans,X[i+2*K+1]-X[i])
        print(ans)

Submission status: Accepted

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

val1=A+A-1
val2=B+B-1
val3=A+B

print(max(val1, val2, val3))

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def POW(x, y):
    if y == 0:
        return 1
    elif y == 1:
        return x
    elif y % 2 == 0:
        return POW(x, y // 2) ** 2 % MOD
    else:
        return POW(x, y // 2) ** 2 * x % MOD
def mod_factorial(x, y): return x * POW(y, MOD - 2) % MOD
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def SI(): return input()
from collections import Counter

def main():
    A, B = LI()
    a, b = max(A, B), min(A, B)
    ans = a
    a -= 1
    ans += max(a, b)

    return ans

print(main())

Submission status: Accepted

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

if A < B:
    print("{}".format(B + B - 1))
elif B < A:
    print("{}".format(A + A - 1))
else:
    print("{}".format(A + B))

Submission status: Accepted

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

if A < B:
    print("{}".format(B + (B - 1)))
elif A > B:
    print("{}".format(A + (A - 1)))
else:
    print("{}".format(A + A))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#!/usr/env/python3
# -*- encoding: utf-8 -*-


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

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

    M = max(A, B)

    print(M * 2 - 1)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

print(result)

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

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

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

Submission status: Accepted

Solution code:
ipt=input()
lst=ipt.split()
A=int(lst[0])
B=int(lst[1])
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)
else:
    print(A+B)

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
else:
    ans+=b
print(ans)