#yuki682 a,b=map(int,raw_input().split()) res=0 for i in xrange(a,b+1): if (a+b+i)%3==0: res+=1 print res