input_list = list(map(int,input().split())) a, b = input_list res = 0 for i in range(a, b + 1): if (a + b + i) % 3 == 0: res += 1 print(res)