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