from sys import stdin def main(): input = lambda: stdin.readline()[:-1] A, B = map(int, input().split()) print(min(A, B) * 2) main()