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