Cow Bridge! Some of Farmer Ran's cows are escaping. N (3 <= N <= 50,000) of them are trying to escape through a mountain pass, a dangerous narrow route which contains are M (1 <= M < N) sequential crevasses that block their escape. Each crevasse as a positive width W (1 <= W < 2^32), and each cow has a positive size S (1 <= W < 2^32) that is a power of 2 (the cows have been on a strange diet recently). In order to cross a crevasse of width W, a group of heroic cows whose sizes sum to at least W form a ``cow bridge'' by laying end to end across the crevasse, each cow holding onto the hooves of the cow in front of her. The other cows walk across this cow bridge and then the bridge cows swing onto the far side of the crevasse, so all the cows cross safely. Unfortunately, once a cow has been part of a bridge, she is too tired to be part of future bridges. Compute the maximum number of crevasses the cows can cross. PROBLEM NAME: cbridge INPUT FORMAT: * Line 1: Three space-separated integers: N, M, and B. * Lines 2..B+2: Line i+1 contains a count of the number of cows of size 2^(i-1). The sum of these lines will be equal to N. * Lines B+3..B+M+2: Each of these lines gives the width of a fissure. SAMPLE INPUT: 7 4 2 2 2 3 6 7 2 4 INPUT DETAILS: 2 cows of size 2^0 = 1, 2 of size 2^1 = 2, and 3 of size 2^2 = 4. Crevasses of sequential widths 6, 7, 2, and 4. OUTPUT FORMAT: * Line 1: The number of crevasses that the cows can cross. SAMPLE OUTPUT: 3 OUTPUT DETAILS: The cows can cross the first three crevasses, using a 2^1 and a 2^2 cow for the first bridge, a 2^0, 2^1, and 2^2 cow for the second bridge, and the remaining 2^2 cow for the third bridge. There are other groupings they could use to cross the first three, but there is no grouping that will get them across the fourth.