# coding: utf-8 # Your code here! import sys readline = sys.stdin.readline read = sys.stdin.read a,b = [int(i) for i in readline().split()] ans = 0 if b > a: a,b = b,a a -= 1 while True: if ans&1==0: if b==0: break b -= 1 else: if a==0: break a -= 1 ans += 1 print(ans)