A,B = map(int,input().split()) ans = 0 for i in range(A,B+1): if (A+B+i)%3==0: ans = (B-A)//3 + 1 break print(ans)