a,b=map(int,input().split()) ans=len(list(filter(lambda x:(a+b+x)%3==0,range(a,b+1)))) print(ans)