A, B = map(int, raw_input().split()) mod3 = (3-(A+B)%3)%3 cnt = 0 for i in range(A, B+1): if i%3 == mod3: cnt += 1 print cnt