a,b = map(int,input().split()) n = b-a if n == 1: print(0) else: cnt = 0 for i in range(a,b+1,1): if (a+(i)+b)%3 == 0: cnt += 1 print(cnt)