N = [int(input()) for i in range(2)] cnt=0 for i in range(N[0],N[1]+1): c = (N[0] + N[1] + i)%3 if c == 0: cnt = cnt + 1 print(cnt)