a, b = map(int, input().split()) ary = [(a + b + i) / 3 for i in range(a, b+1)] print(len(list(filter(lambda x: x.is_integer(), ary))))