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