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 while b != 0: ans += 1 b -= 1 if a == 0: break ans += 1 a -= 1 print(ans)