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