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