a,b = map(int, input().split()) print (0 if (b-a) == 1 else (b-a)//3+1)