a,b=map(int,input().split()) print(max(min(a-1,b),min(a,b-1))*2)