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

Submission status: Accepted

Solution code:
if __name__ == "__main__":
    button = input()
    button = button.split(" ")
    button1 ,button2 = int(button[0]),int(button[1])
    total = 0
    for x in range(2):
        if button1>button2:
            total+=button1
            button1-=1
        else:
            total+=button2
            button2-=1
    print(total)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
num = input().split(' ')
a, b = int(num[0]), int(num[1])
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()))
if a == b:
  print(2*a)
else:
  print( 2*max(a,b)-1)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
[a,b]=[int(i) for i in 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())
# A = 6
# B = 6
C = 0

AB = [A, B]
AB.sort(reverse=True)

C += AB[0]
AB[0] -= 1

AB.sort(reverse=True)
C += AB[0]

print(C)

Submission status: Accepted

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

ans = max(A, B) + max(min(A, B), max(A, B) - 1)

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

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:

#input
#[A, B] = [5, 3]
[A, B] = list(map(int,input().split()))
if A == B:
    print(2*A)
else:
    print(2*max(A,B)-1)

Submission status: Accepted

Solution code:
num = list(map(lambda x: int(x), input().split(" ")))
total = max(num)
num[num.index(max(num))] -= 1
total += max(num)
print(total)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

mx = max(a, b)
mn = min(a, b)

r = mx
mx -= 1
r += max(mx, mn)

print(r)

Submission status: Accepted

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

max1 = max(input)
min = min(input)
compare = max1 - 1
list = [min,compare]
max2 = max(list)

result = max1 + max2
print(result)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
input_number = input().split()

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

max_number = 0

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

else:
    max_number += b
    b -= 1


if a >= b:
    max_number += a

else:
    max_number += b

print(max_number)

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
from sys import exit
A,B = [int(n) for n in input().split()]
# N = int(input())
# a = [int(input()) for _ in range(N)]
# S = str(input())
# L = len(S)
# T = str(input())
# exit()
ans = 0
if A < B:
    ans = ans + B
    B-=1
else:
    ans = ans + A
    A-=1

ans+=max(A,B)
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(2 * a)

Submission status: Accepted

Solution code:
A,B=[int(e) for e in input().split(' ')]
print(max([A+A-1,A+B,B+B-1]))

Submission status: Accepted

Solution code:
list = list(map(int, input().split()))
print(max([list[0]*2-1,list[0]+list[1],list[1]*2-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:
import math
import os
import random
import re
import sys
from collections import defaultdict

if __name__ == '__main__':
    s, k = map(int, input().split())
    print(max(s+s-1,s+k,k+k-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
else:
  print(ans)

Submission status: Accepted

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

num_coins = 0

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

print(num_coins)

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import numpy as np

def main():
    i=list(map(int, input().split()))
    coin=0
    if (i[0]<i[1]):
        coin =coin+i[1]
        i[1] =i[1]-1
    else:
        coin = coin + i[0]
        i[0] = i[0] - 1
    if (i[0] < i[1]):
        coin = coin + i[1]
        i[1] = i[1] - 1
    else:
        coin = coin + i[0]
        i[0] = i[0] - 1
    print(coin)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
import math
import collections
import itertools
import array
import inspect

# Set max recursion limit
sys.setrecursionlimit(1000000)


# Debug output
def chkprint(*args):
    names = {
        id(v): k
        for k, v in inspect.currentframe().f_back.f_locals.items()
    }
    print(', '.join(
        names.get(id(arg), '???') + ' = ' + repr(arg) for arg in args))


# Binary converter
def to_bin(x):
    return bin(x)[2:]


def li_input():
    return [int(_) for _ in sys.stdin.readline().split()]


def gcd(n, m):
    if n % m == 0:
        return m
    else:
        return gcd(m, n % m)


def gcd_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = gcd(v, L[i])

    return v


def lcm(n, m):
    return (n * m) // gcd(n, m)


def lcm_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = lcm(v, L[i])

    return v

def comb(n, r):
    if n - r < r: r = n - r
    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 bisearch(L, target):
    low = 0
    high = len(L) - 1
    
    while low <= high:
        mid = (low + high) // 2
        guess = L[mid]
        if guess == target:
            return True
        elif guess < target:
            low = mid + 1
        elif guess > target:
            high = mid - 1
    if guess != target:
        return False

# --------------------------------------------

dp = None


def main():
    A, B = li_input()

    ans = 0

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

    print(ans)


main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
AB = input().split()
A,B=int(AB[0]), int(AB[1])
if max(A,B)-min(A,B) >= 1:
  print(2*max(A,B)-1)
else:
  print(A+B)

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

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:
    ret = A * 2
    print(ret)

else:
    ret = max([A, B]) * 2 - 1
    print(ret)

Submission status: Accepted

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

print(s)

Submission status: Accepted

Solution code:
import sys

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

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

Submission status: Accepted

Solution code:
n=[i for i in input().split()]
a=int(n[0])
b=int(n[1])
S1=a+b
S2=a+a-1
S3=b+b-1

p=[S1,S2,S3]
print(max(p))

Submission status: Accepted

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

Submission status: Accepted

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

print(s)

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

Submission status: Accepted

Solution code:
def button(x,y):
  return max(2*x-1, 2*y-1, x+y)

inputs = input()
x,y  = list(map(lambda x:int(x),inputs.split()))
print(button(x,y))

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

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

Submission status: Accepted

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

if a > b:
  count = a
  a = a - 1
  if a > b or a == b:
    count = count + a
elif b > a:
  count = b
  b = b - 1
  if b > a or a == b:
    count = count + b
else:
  count = a
  count = count + b

print(count)

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

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

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 = 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:
    coins = A
    A -= 1
else:
    coins = B
    B -= 1
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())
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:
i = list(map(int,input().split()))
count = 0;

for num in range(2):
    if(i[0] < i[1]):
        count = count + i[1]
        i[1] = i[1] - 1
    else:
        count = count + i[0]
        i[0] = i[0] - 1

print(count)

Submission status: Accepted

Solution code:
a, b = 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:
import numpy as np


def get_coin(button_sizes):
    largest_button = np.argmax(button_sizes)
    earned = button_sizes[largest_button]
    button_sizes[largest_button] -= 1
    return earned


if __name__ == '__main__':
    button_sizes = np.array([int(x) for x in input().split(' ')])
    coin = 0
    for i in range(2):
        coin += get_coin(button_sizes)
    print(coin)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

if __name__ == "__main__":
    Main()

Submission status: Accepted

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

Submission status: Accepted

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

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

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

print(c+d)

Submission status: Accepted

Solution code:
n = input().split()
count = 0
if int(n[0]) > int(n[1]):
  count +=int(n[0])
  if int(n[0])-1 > int(n[1]):
    count +=int(n[0])-1
  else:
    count +=int(n[1])
else:
  count +=int(n[1])
  if int(n[1])-1 > int(n[0]):
	  count +=int(n[1])-1
  else:
	  count +=int(n[0])

print(count)

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

Submission status: Accepted

Solution code:
a,b = [int(i) for i in  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())
c=0
if a>b:
    c=a+(a-1)
elif a==b:
    c=a+b
else:
    c=b+(b-1)
print(c)#

Submission status: Accepted

Solution code:
in_list = input().split()

A = int(in_list[0])
B = int(in_list[1])
coin_sum = 0

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

print(coin_sum)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
A,B = (int(x) for x in input().split())
if A >= B :
    C = A
    A = A - 1
else :
    C = B
    B = B - 1

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

Submission status: Accepted

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

A, B = map(int, raw_input().split())
print '{}'.format( max(A+A-1, max(B+B-1, A+B)) )

Submission status: Accepted

Solution code:
def Y(flag):
    if flag:
        print('YES')
    else:
        print('NO')
 
def y(flag):
    if flag:
        print('Yes')
    else:
        print('No')
 
a,b = map(int,input().split())
l = [a,b,a-1,b-1]
l = sorted(l)
print(l[-1] + l[-2])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def func(a, b):
    if a > b:
        return 2*a - 1
    elif a < b:
        return 2*b - 1
    else:
        return 2*a

[sa, sb] = input().split()
a = int(sa)
b = int(sb)
print(func(a,b))

Submission status: Accepted

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

for _ in range(2):
    c += max(A, B)
    if max(A, B) == A:
        A = A - 1
    elif max(A, B) == B:
        B = B - 1

print(c)

Submission status: Accepted

Solution code:
#A - Buttons
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:
  tmp = b
  b = a
  a = tmp

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

Submission status: Accepted

Solution code:
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()))
result = max(a,b) * 2

if a != b:
  result = result - 1
 
print(result)

Submission status: Accepted

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

if a == b:
    print(a + b)
    exit()

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

Submission status: Accepted

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

Submission status: Accepted

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

sum = 0

sum += max(A, B)

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

print(sum)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b = (int(i) for i in input().split())
i = 0
c = 0
for i in range(2):
    i += i + 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())
x = 0
if a > b:
    x = a + (a-1)
if a == b:
    x = a + b
if a < b:
    x = b + (b-1)
print(x)

Submission status: Accepted

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

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

Submission status: Accepted

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

result = result + max(a,b)

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

print(result)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = [int(s) for s in input().split(" ")]
print(max(a) * 2 if max(a) == min(a) else max(a) * 2 - 1)

Submission status: Accepted

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

Submission status: Accepted

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

# スペース区切りの整数の入力
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(str(coins))

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

res = 0
for i in range(2):
    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())

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

Submission status: Accepted

Solution code:
a, b = [int(i) for i in 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 = list(map(int, input().split()))

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

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())
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:
# -*- coding: utf-8 -*-

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

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
from sys import stdin
a, b = [int(x) for x in stdin.readline().rstrip().split()]
res = 0
if a > b:
    res += a
    a -= 1
else:
    res += b
    b -= 1
res += a if a > b else b
print("{}".format(res))

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:
s = input().split()
 
if int(s[0]) < int(s[1]):
  s1 = int(s[0])
  s2 = int(s[1])
else:
  s1 = int(s[1])
  s2 = int(s[0])
  
result = 0
if (s2-s1) >= 2:
  result = s2*2 - 1
else:
  result = s2 + s1
 
print(result)

Submission status: Accepted

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


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

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

if a < b:
  a,b = b,a

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A,B=map(int,input().split())
if A > B:
  ans = A + A - 1
if A < B:
  ans = B + B - 1
if A == B:
  ans = 2 * A
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 += b
        b = b - 1
    else:
        c += a
        a = a - 1

print(c)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
a,b = sys.stdin.readline().rstrip('\n').split()
a = int(a)
b = int(b)
print(max(a+b,a*2-1,b*2-1))

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

ｖ = input().split(' ')
a = int(v[0])
b = int(v[1])

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

print(max(vals))

Submission status: Accepted

Solution code:
l = list(map(int,input().split()))
print(max(l)+max([max(l)-1,min(l)]))

Submission status: Accepted

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

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

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

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:
def solve(A, B, n):
    if n == 1:
        return max(A, B)
    else:
        n -= 1
        h, l = max(A, B), min(A, B)
        return h + solve(h-1, l, n)

A, B = map(int, input().split())
print(solve(A, B, 2))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

import math, itertools, operator
from math import *
from math import factorial as fact
from functools import reduce
from statistics import mean, median, median_low, median_high, mode
# Before Python 3.5
from fractions import gcd
#import numpy
#import scipy, scipy.special
#from sympy import isprime, nextprime
#from sympy.ntheory import factorint

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

def perm(a, b):
    import scipy.special
    return scipy.special.perm(a, b, exact = True)

def comb(a, b):
    import scipy.special
    return scipy.special.comb(a, b, exact = True)

def dfact(n):
    import scipy.special
    return scipy.special.factorial2(n, exact = True)

def prod(l):
    return reduce(operator.mul, l)

def input_ints(inp = input, sep = ' ', conv = int):
    return map(conv, inp().split(sep = sep))

################################################################################

A, B = input_ints()
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(A + A-1,A+B,B+B-1))