a, b = gets.chomp.split.map(&:to_i) ans = 0 c = 3 - (a + b) % 3 (a..b).to_a.each do |i| ans += 1 if i % 3 == c end puts ans