The penalty is on withdrawing earnings, but you can take out any amount equal or below your total contributions (which were made post tax, after all). So, for example, if you were to contribute $5k/year for 20 years, you could pull out $100k penalty-free.