A, B = map(int, input().split()) max_n = max(A, B) min_n = min(A, B) for n in reversed(range(max_n, 2 * max_n + 1)): if n - min_n == max_n: print(n) exit(0)