import sys readline = sys.stdin.buffer.readline def even(n): return 1 if n%2==0 else 0 a,b = map(int,readline().split()) if a < b: a,b = b,a a -= 1 print(min(a,b)*2)