a, b = gets.split.map(&:to_i) ans = 0 a.upto(b) do |i| if (a + b + i) % 3 == 0 ans += 1 end end p ans