When Can You Quit? The Math Behind (Early) Retirement