a,b=map(int,input().split()) if a >= b: print(2*b) else: print(2*a)