def ascan; gets.split.map(&:to_i);end A,B = ascan cnt = 0 A.upto(B) do |e| cnt += 1 if (A+B+e)%3 == 0 end p cnt