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