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