Do you keep the (5) before rolling?

Keep in mind that a tie is a loss.

On a side note, how hard would it be to program something that can solve this kind of problem?