A,B=map(int,input().split()) a = A%3 b = B%3 c = (3 - (a+b) % 3) % 3 print(((B-c)//3) - ((A-c)//3) + 1)