若两个操纵杆的·电量都为1的话,那么持续时间为0
因此需要特别判断:一个操纵杆电量必须大于1,另一个>=1
joystick = map(int,raw_input().split())
result = 0
while True:
if (joystick[0] >= 1 and joystick[1] > 1) or (joystick[0]>1 and joystick[1] >=1):
joystick = sorted(joystick)
joystick[0] += 1
joystick[1] -= 2
result += 1
else:
break
print result