Measurement of the inclusive charmless and double-charm B branching ratios