a, b = map(int, input().split()) print(sum([1 for i in range(a, b + 1) if (a + i + b) % 3 == 0]))