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