import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines A,B = map(int,read().split()) answer = sum((A+B+i)%3 == 0 for i in range(A,B+1)) print(answer)