print((function (a, b) local t,r=3-(a+b)%3,0 for i=a,b do if i%3==t then r=r+1 end end return r end)(io.stdin:read("*n"), io.stdin:read("*n")))