import sys sys.setrecursionlimit(10 ** 8) input = sys.stdin.readline def main(): A, B = [int(x) for x in input().split()] print(min(A, B) * 2) if __name__ == '__main__': main()