Per the IRS Instructions for Form 5329 Additional Taxes on Qualified Plans (Including IRAs) and Other Tax-Favored Accounts, page 3:
The additional tax on early distributions doesn’t apply to the distributions described next. Enter on line 2 the amount that you can exclude. In the space provided, enter the applicable exception number (01–12). If more than one exception applies, enter 12.
Exception No. 05
Qualified retirement plan distributions up to the amount you paid for unreimbursed medical expenses during the year minus 10% of your adjusted gross income (AGI) for the year..