a,b = map(int,input().split(" ")) if (a+b)==2: result =1 elif (a+b)>2: if a>b: result = 2*b elif a