A,B = gets.split.map(&:to_i) puts (A..B).count{|i| (A+B+i) % 3 == 0}