You are roleplaying as an adventurer under the direction of a sadistic DM who has just thrown your character down a well.
In order to escape, you have unlimited chances at a STAMINA check, difficulty level 21. Such a check entails spending some number of STAMINA reserve points (currently you have 30), and then adding that number to the result of a roll of a 20-sided die. You escape with a 21 or greater.
Your DM is showing a rare glimmer of mercy, and promises you that you'll automatically escape if you wind up spending all your STAMINA reserve points.
What is the most STAMINA-efficient strategy for escaping the well?
(Precise statement: Find the point-spending strategy P maximizing E(X_P), where E(-) is expected value in the context of fair dice rolls, and X_P is the random variable denoting STAMINA points left after escaping according to P. Note, a "strategy" doesn't have to be the same amount of points spent repeatedly; it can be any decision procedure for escape.)