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

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

Submission status: Accepted

Solution code:
A,B = map(int,input().split())
if abs(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:
  ans = a + max(a-1, b)
else:
  ans = b + max(b-1, a)
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)
    
else:
    a = max([A,B])
    print(a + (a-1))

Submission status: Accepted

Solution code:
a, b = map(int,input().split())
A = max(a,b)
B = min(a,b)

if A > B:
    ans = 2 * A - 1
elif A == B:
    ans = 2 * A

print(ans)

Submission status: Accepted

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


ma = max(a,b)
mi = min(a,b)

ans = 0
ans += ma
ma -= 1
ans += max(ma,mi)

print(ans)

Submission status: Accepted

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

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(2*a)

Submission status: Accepted

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

c = 0

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

print(c)

Submission status: Accepted

Solution code:
list = [int(i) for i in input().split(" ")]
a = max(list)
b = min(list)

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

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:

but=list(map(int,input().split()))
but = sorted(but)
res = but[-1]
but[-1] -= 1
but = sorted(but)
res += but[-1]
print(res)

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:
ab = [int(i) for i in input().split()]
a = ab[0]
b = ab[1]

s = max(ab)
if a > b:
    s = s + a-1
elif a < b:
    s = s + b-1
else:
    s = 2*s

print(s)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A,B = (int(x) for x 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:
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())
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())
result = []

result.append(a + (a-1))
result.append(a + b)
result.append(b + (b-1))

print(max(result))

Submission status: Accepted

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

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

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

print(cnt)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
hako = [a, a - 1, b, b - 1]
hako.sort(reverse=True)
hako = hako[:2]
print(sum(hako))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
A2 = A+(A-1)
B2 = B+(B-1)
AB = A+B

print(max(A2,B2,AB))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
"""
# 標準入力取得
## 文字列
 = sys.stdin.readline().rstrip()
 = list(sys.stdin.readline().rstrip())

## 数値
 = int(sys.stdin.readline())
 = map(int, sys.stdin.readline().split())
 = list(map(int, sys.stdin.readline().split()))
 = [list(map(int,list(sys.stdin.readline().split()))) for i in range(h)]  # 二次元配列入力　二次元マップみたいな入力のとき

# 0埋め, 小数点出力桁指定時のときの出力
a = 100
b = 0.987654321
print("{0:06d}-{1:6f}".format(a,b))
000100-0.987654

# 文字列をリストに格納
char_list = list("abcd") # ["a","b","c","d"]
"""

import math
import sys
import itertools
import queue
from fractions import gcd

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

mod = 1000000007

if __name__ == "__main__":
    a,b = map(int, sys.stdin.readline().split())
    if a==b:
        print(a+b)
    else:
        n=max(a,b)
        m=min(a,b)
        if n > m+1:
            print(2*n-1)
        else:
            print(a+b)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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:
li = sorted(list(map(int, input().split())))
if li[1] - 1 >= li[0]:
    print(int(2 * li[1] - 1))
else:
    print(sum(li))

Submission status: Accepted

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

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

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())
coin = 0
if a > b:
    coin += a
    a -= 1
else:
    coin += b
    b -= 1

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

print(coin)

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
A,B=map(int,input().split())
point=0
for _ in range(2):
    if A>=B:
        point=point+A
        A=A-1
    else:
        point=point+B
        B=B-1
print(point)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-


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

    ans = list()
    ans.append(a + b)
    ans.append(a + a - 1)
    ans.append(b + b - 1)

    print(max(ans))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
A, B = raw_input().split()
A = int(A)
B = int(B)
coin = 0

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

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

Submission status: Accepted

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

score = 0

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

print(score)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
num = input().split()
a, b = int(num[0]),int(num[1])

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

print(max_tmp)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
import math
from collections import deque

sys.setrecursionlimit(4100000)


def inputs(num_of_input):
    ins = [input() for i in range(num_of_input)]
    return ins


def solve(inputs):
    [a, b] = string_to_int(inputs[0])

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

    return ret


def string_to_int(string):
    return list(map(lambda x: int(x), string.split()))


if __name__ == "__main__":
    ret = solve(inputs(1))
    print(ret)

Submission status: Accepted

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

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

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())
coin = [A + (A - 1),A+B,B + (B - 1)]
print(max(coin))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A,B=list(map(int,input().split()))
C=0
for i in range(2):
    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())
print(max(2*A-1,A+B,2*B-1))

Submission status: Accepted

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

    sum += b
    b -= 1

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

Submission status: Accepted

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

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

# solve & output
print(max(A + A - 1, B + B - 1, A + B))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
x = [int(n) for n in input().split()]
if x[0] > x[1]:
    print(x[0]*2 - 1)
elif x[0] == x[1]:
    print(x[0]*2)
else:
    print(x[1]*2 - 1)

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
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(' '))
coins = 0
for i in range(0, 2):
    if a > b:
        coins += a
        a -= 1
    else:
        coins += b
        b -= 1
print(coins)

Submission status: Accepted

Solution code:
import sys
from collections import deque  # 双方向キュー
from collections import defaultdict  # 初期化済み辞書
from heapq import heapify, heappush, heappop, heappushpop  # プライオリティキュー
from bisect import bisect_left, bisect_right  # 二分探索
#import numpy as np  # 1.8.2
#import scipy  # 0.13.3
#sys.setrecursionlimit(int(1e+6))
s2nn = lambda s: [int(c) for c in s.split(' ')]
ss2nn = lambda ss: [int(s) for s in ss]
ss2nnn = lambda ss: [s2nn(s) for s in ss]
i2s = lambda: sys.stdin.readline().rstrip()
i2n = lambda: int(i2s())
i2nn = lambda: s2nn(i2s())
ii2ss = lambda n: [sys.stdin.readline().rstrip() for _ in range(n)]
ii2sss = lambda n: [list(sys.stdin.readline().rstrip()) for _ in range(n)]
ii2nn = lambda n: ss2nn(ii2ss(n))
ii2nnn = lambda n: ss2nnn(ii2ss(n))
MOD = int(1e+9) + 7

def main():
    A, B = i2nn()
    if A == B:
        print(A + B)
    elif A > B:
        print(A + A - 1)
    else:
        print(B + B - 1)

main()

Submission status: Accepted

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

Submission status: Accepted

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

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

if A > B:
    ans = A*2 - 1
elif A == B:
    ans = A*2
else:
    ans = B*2 - 1

print(ans)

Submission status: Accepted

Solution code:
# using main() makes code faster from the point of view of "access to variables in global name-space"
# def main():

""" convenient functions
# for i, a in enumerate(iterable)
# q, mod = divmod(a, b)
# divmod(x, y) returns the tuple (x//y, x%y)
# manage median(s) using two heapq https://atcoder.jp/contests/abc127/tasks/abc127_f
"""

import sys
sys.setrecursionlimit(10**7)
from itertools import accumulate, combinations, permutations, product # https://docs.python.org/ja/3/library/itertools.html
# accumulate() returns iterator! to get list: list(accumulate())
from math import factorial, ceil, floor
def factorize(n):
    """return the factors of the Arg and count of each factor
    
    Args:
        n (long): number to be resolved into factors
    
    Returns:
        list of tuples: factorize(220) returns [(2, 2), (5, 1), (11, 1)]
    """
    fct = []  # prime factor
    b, e = 2, 0  # base, exponent
    while b * b <= n:
        while n % b == 0:
            n = n // b
            e = e + 1
        if e > 0:
            fct.append((b, e))
        b, e = b + 1, 0
    if n > 1:
        fct.append((n, 1))
    return fct
def combinations_count(n, r):
    """Return the number of selecting r pieces of items from n kinds of items.
    
    Args:
        n (long): number
        r (long): number
    
    Raises:
        Exception: not defined when n or r is negative
    
    Returns:
        long: number
    """
    # TODO: How should I do when n - r is negative?
    if n < 0 or r < 0:
        raise Exception('combinations_count(n, r) not defined when n or r is negative')
    if n - r < r: r = n - r
    if r < 0: return 0
    if r == 0: return 1
    if r == 1: return n
    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]
    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot
    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])
    return result
def combinations_with_replacement_count(n, r):
    """Return the number of selecting r pieces of items from n kinds of items allowing individual elements to be repeated more than once.
    
    Args:
        n (long): number
        r (long): number
    
    Raises:
        Exception: not defined when n or r is negative
    
    Returns:
        long: number
    """
    if n < 0 or r < 0:
        raise Exception('combinations_with_replacement_count(n, r) not defined when n or r is negative')
    elif n == 0:
        return 1
    else:
        return combinations_count(n + r - 1, r)
from bisect import bisect_left, bisect_right
from collections import deque, Counter, defaultdict # https://docs.python.org/ja/3/library/collections.html#collections.deque
from heapq import heapify, heappop, heappush, heappushpop, heapreplace,nlargest,nsmallest # https://docs.python.org/ja/3/library/heapq.html
from copy import deepcopy, copy # https://docs.python.org/ja/3/library/copy.html
from operator import itemgetter
# ex1: List.sort(key=itemgetter(1))
# ex2: sorted(tuples, key=itemgetter(1,2))
from functools import reduce
def chmin(x, y):
    """change minimum
    if x > y, x = y and return (x, True).
    convenient when solving problems of dp[i]
    
    Args:
        x (long): current minimum value
        y (long): potential minimum value
    
    Returns:
        (x, bool): (x, True) when updated, else (x, False)
    """
    if x > y:
        x = y
        return (x, True)
    else:
        return (x, False)
def chmax(x, y):
    """change maximum
    if x < y, x = y and return (x, True).
    convenient when solving problems of dp[i]
    
    Args:
        x (long): current maximum value
        y (long): potential maximum value
    
    Returns:
        (x, bool): (x, True) when updated, else (x, False)
    """
    if x < y:
        x = y
        return (x, True)
    else:
        return (x, False)

from fractions import gcd # Deprecated since version 3.5: Use math.gcd() instead.
def gcds(numbers):
    return reduce(gcd, numbers)
def lcm(x, y):
    return (x * y) // gcd(x, y)
def lcms(numbers):
    return reduce(lcm, numbers, 1)

# first create factorial_list
# fac_list = mod_factorial_list(n)
INF = 10 ** 18
MOD = 10 ** 9 + 7
modpow = lambda a, n, p = MOD: pow(a, n, p) # Recursive function in python is slow!
def modinv(a, p = MOD):
    # evaluate reciprocal using Fermat's little theorem:
    # a**(p-1) is identical to 1 (mod p) when a and p is coprime
    return modpow(a, p-2, p)
def modinv_list(n, p = MOD):
    if n <= 1:
        return [0,1][:n+1]
    else:
        inv_t = [0,1]
        for i in range(2, n+1):
            inv_t += [inv_t[p % i] * (p - int(p / i)) % p]
        return inv_t
def modfactorial_list(n, p = MOD):
    if n == 0:
        return [1]
    else:
        l = [0] * (n+1)
        tmp = 1
        for i in range(1, n+1):
            tmp = tmp * i % p
            l[i] = tmp
        return l
def modcomb(n, k, fac_list = [], p = MOD):
    # fac_list = modfactorial_list(100)
    # print(modcomb(100, 5, modfactorial_list(100)))
    from math import factorial
    if n < 0 or k < 0 or n < k: return 0
    if n == 0 or k == 0: return 1
    if len(fac_list) <= n:
        a = factorial(n) % p
        b = factorial(k) % p
        c = factorial(n-k) % p
    else:
        a = fac_list[n]
        b = fac_list[k]
        c = fac_list[n-k]
    return (a * modpow(b, p-2, p) * modpow(c, p-2, p)) % p
def modadd(a, b, p = MOD):
    return (a + b) % MOD
def modsub(a, b, p = MOD):
    return (a - b) % p
def modmul(a, b, p = MOD):
    return ((a % p) * (b % p)) % p
def moddiv(a, b, p = MOD):
    return modmul(a, modpow(b, p-2, p))

""" initialize variables and set inputs
# initialize variables
    # to initialize list, use [0] * n
    # to initialize two dimentional array, use [[0] * N for _ in range(N)]
# set inputs
    # open(0).read() is a convenient method:
    # ex) n, m, *x = map(int, open(0).read().split())
    #     min(x[::2]) - max(x[1::2])
    # ex2) *x, = map(int, open(0).read().split())
    #     don't forget to add comma after *x if only one variable is used
# preprocessing
    # transpose = [x for x in zip(*data)]
    # ex) [[1, 2, 3], [4, 5, 6], [7, 8, 9]] => [(1, 4, 7), (2, 5, 8), (3, 6, 9)]
    # flat = [flatten for inner in data for flatten in inner]
    # ex) [[1, 2, 3], [4, 5, 6], [7, 8, 9]] => [1, 2, 3, 4, 5, 6, 7, 8, 9]
# calculate and output
    # output pattern
    # ex1) print(*l) => when l = [2, 5, 6], printed 2 5 6
"""

# functions used
r = lambda: sys.stdin.readline().strip()
r_int = lambda: int(r())
R = lambda: list(map(int, r().split()))
Rfloat = lambda: list(map(float, r().split()))
Rtuple = lambda: tuple(map(int, r().split()))
Rmap = lambda: map(int, r().split())

""" how to treat input
# single int: int(r())
# single string: r()
# single float: float(r())
# line int: R()
# line string: r().split()
# line (str, int, int): [j if i == 0 else int(j) for i, j in enumerate(r().split())]
# lines int: [R() for _ in range(n)]
"""


# ----------------------------------
# main
A, B = R()
print(max(A+B,A+A-1,B+B-1))

# end of main
# ----------------------------------

"""memo: how to use defaultdict of list
# initialize
Dic = defaultdict(list)
# append / extend
Dic[x].append(y)
# for
for k, v in Dic.items():
"""

# if __name__ == '__main__':
#     main()

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
    else:
        cnt += b
        b -= 1

print(cnt)

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, a*2-1,b*2-1))

Submission status: Accepted

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


main()

Submission status: Accepted

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

Submission status: Accepted

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

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
    else:
        total += b
        b -= 1

print(total)

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:
def A(a,b):
    if a == b:
        return a+b
    elif a > b:
        return a+(a-1)
    elif b > a:
        return b+(b-1)

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

Submission status: Accepted

Solution code:
a, b = list(map(int, input().split()))
aa = a-1
bb = b-1
lst = sorted([a, b, aa, bb])

print(lst[2]+lst[3])

Submission status: Accepted

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

ans = max(ls)
for i in range(len(ls)):
  if ls[i] == ans:
    ls[i] += -1
    break
ans += max(ls)
print(ans)

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

Submission status: Accepted

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

ans = 0

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
AB=sorted(list(map(int,input().split())),reverse=True)

at=AB[0]*2-1
bt=AB[0]+AB[1]
print(max(at,bt))

Submission status: Accepted

Solution code:
# n=int(input())
# a,b=map(int, input().split())
# c=list(map(int, input().split()))
# s=[list(map(int,list(input()))) for i in range(h)]  # 二次元配列入力　二次元マップみたいな入力のとき

# a=100
# b=0.987654321
# print('{0:06d}-{1:6f}'.format(a,b))  # 0埋めのときの出力
# 000100-0.987654

import numpy as np
import math
import copy

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

n = 0

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

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

print(n)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#2 個のボタンがあり、大きさはそれぞれ A,B です。大きさ X のボタンを押すと、X 枚のコインを獲得し、そのボタンの大きさが 1 小さくなります。
#あなたは、いずれかのボタンを押すことを 2 回行います。 同じボタンを 2 回押しても構いません。
#最大で何枚のコインを獲得できるでしょうか。

#解説
#大きい方のボタンを選んで押すことを 2 回繰り返すのが最適です。基本的には同じボタンを押しますが、 
#A = B のときは両方のボタンを 1 回ずつ押すのが最適なので、注意する必要があります。
#実装では、以下の 3 つのパターンについて場合分けすると比較的簡単に書くことができます。
#• A > B の場合: A+(A−1) が答えになります。 • A < B の場合: B + (B − 1) が答えになります。 • A = B の場合: A+B が答えになります。

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

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

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

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

out = 0

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

Submission status: Accepted

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

Submission status: Accepted

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

cnt = 0
ans = 0

while cnt < 2:
    if a >= b:
        ans += a
        a -= 1
    else:
        ans += b
        b -=1
    cnt += 1
    
print(ans)

Submission status: Accepted

Solution code:
A,B=map(int,input().split())
L=[]
L.append(A)
L.append(B)
first=max(L)
L.remove(max(L))
L.append(first-1)
second=max(L)
print(first+second)

Submission status: Accepted

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

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())
print(max(a+(a-1), a+b, b+a, b+(b-1)))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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())
print(max((A + A - 1), (A + B), (B + B - 1 )))

Submission status: Accepted

Solution code:
#ABC124-A
A = list(map(int,input().split()))
if A[0]==A[1]:
    ans=A[0]*2
else:
    set=max(list(A))
    ans=set+(set-1)
print(ans)

Submission status: Accepted

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

k=max(a,b)

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

Submission status: Accepted

Solution code:
A,B = map(int,input().split())
n = 0
ans = []
while n <2:
    if A<B:
        ans.append(B)
        B -=1
        n +=1
    elif A>=B:
        ans.append(A)
        A -=1
        n +=1
print(sum(ans))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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