A, B = map(int, input().split()) count = 0 for T in range(A, B+1): if (A + B + T) % 3 == 0: count += 1 print(count)