s,e=map(int,input().split()) cnt=0 for i in range(s,e+1): f=(s+e+i)/3 if(f.is_integer()): cnt+=1 print(cnt)