$l, $r = gets.split.map(&:to_i) def join(x) if $l <= x && x <= $r then return true else return false end end ans = 0 if join(295) && join(296) then ans += 1 end if join(416) && join(417) then ans += 1 end puts ans