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