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