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