input = gets.split(" ") a = input[0].to_i b = input[1].to_i count = 0 for i in a..b if ((a + b + i) % 3) == 0 count += 1 end end puts count