a, b = map(int, input().split()) c = [i for i in range(a, b+1)] x = 0 for i in c: if (a+b+i) % 3 == 0: x += 1 print(x)