a,b=map(int,input().split()) ans=0 for i in range(a,b+1): c=(a+b+i)/3 if c.is_integer(): ans+=1 print(ans)