import numpy as np a,b=map(int,input().split()) c=np.arange(a,b+1) print(np.sum(np.where((a+b+c)%3==0,1,0)))