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