a, b = map(int, input().split()) s = a + b mod = s % 3 num = 0 for i in range(a, b + 1): if (i % 3 + mod) % 3 == 0: num += 1 print(num)