a, b = tuple(map(int, input().split(" "))) print(len(tuple(filter(lambda x: x / 3 == int(x / 3), list(map(lambda x: a + b + x, range(a, b + 1)))))))