If P(H) varies by coin, it will be hard to do better than adding up all the cases. If P(H) is the same for all coins and P(T)=1-P(H) you can use the binomial theorem. First calculate how many coins need to come heads to make a profit. For example, if P(H) = 0.5 you should win 1/.45 -1= 11/9 for heads (is this what you mean for 5% value? I could argue for various other figures, but let's use this) and lose 1 for tails. To break even, then, you need to get tails 11/20 of the time and to lose you need more tails than that. So the probability of loss in $n$ throws is $$\frac{1}{2^n}\sum_{k=0}^{\lceil \frac{9k}{20} \rceil -1} \binom{n}{k}$$ If the coin is not fair, you will need to bring the P(H) into the sum.