A, B = map(int, input().split()) sum_ab = A + B target_mod = (3 - (sum_ab % 3)) % 3 count = 0 for i in range(A, B + 1): if i % 3 == target_mod: count += 1 print(count)