A, B = [int(x) for x in input().split(' ')] print(sum(1 for i in range(A, B + 1) if (A + B + i) % 3 == 0))