Optimally generating a desired result from a set of biased coins

The numbers below reflect my specific problem, but a general solution will also be appreciated.

You have 23 identical biased coins:

• $\Pr[\text{Heads}] = 1/6$
• $\Pr[\text{Tails}] = 5/6$

Desired result: 8 heads and 15 tails

You can flip each coin as many times as you want, but once you "lock" its result, you cannot flip it again in the future. Suppose you have already flipped some coins and "locked" the results. You have gotten $h$ heads and $t$ tails so far. You flip the next coin and get either a head or tail. You must now decide whether to "lock" the result or flip it again. How should you decide what to do to minimize the total number of expected coin flips to get the desired result?