By Mark Struthers

Learn more about Mark on NerdWallet’s Ask an Advisor

Open enrollment, that time of the year when you can make changes to various benefits options at your workplace, is just around the corner. For most companies, it occurs during the last quarter of the year, October through December.

Those of you with a high-deductible health plan, or HDHP (for 2016, that’s a plan with a deductible of at least $1,300 for an individual or $2,600 for a family), may have the option to open a health savings account, or HSA.

If you have an HDHP, you or your employer can contribute money tax-free to your HSA, up to certain limits, so that you can use tax-free funds to pay for noncovered qualified medical expenses, like deductibles, copays, vision and dental care. The 2016 contribution limit is $6,750 for families and $3,350 for an individual.

One great advantage of these accounts is that you contribute pretax income, the money grows tax-free, and you don’t pay tax when you withdraw it to use it for eligible medical expenses. In addition, because you’re putting pretax money aside, it lowers your overall taxable income. Plus, it offers significant retirement savings and investment options, which we’ll detail in this article.

An HSA is not the only tax-advantaged health plan. The flexible spending account, or FSA, is also a popular option. Unlike an FSA, however, an HSA is not a use-it-or-lose-it proposition. The money in an HSA rolls over from year to year, and if used for qualified health care expenses, both contributions and earnings come out tax-free. There is no other account like it. And this is where the opportunity lies.

In addition to its other advantages, an HSA is a good retirement savings option, especially for high-income earners who can’t make deductible contributions to a traditional IRA or any contributions to a Roth IRA.

As with any investment, pay careful attention to risk. If you are 100% sure you will need the funds for health care, then low-risk, cash-like investments are best. But if you don’t need the funds or can pay expenses from other sources, allowing the HSA to grow, then the account can add to the growth and diversification of your portfolio.

One investment strategy that works well for an HSA is a three-bucket strategy. Each bucket has a different risk level for different time frames:

Bucket 1: Low-risk investments to cover one to two years of medical expenses, if needed. If you know you will need the money in a year or two, don’t take chances. Put your funds in low-risk investments.

Bucket 2: Low-to-medium-risk investments to act as a backup to Bucket 1 and used to replenish Bucket 1.

Bucket 3: Higher-risk, higher-growth investments. These funds are for use in 10 years or more, for example, for ordinary expenses in retirement or to cover things that Medicare doesn’t, including long-term care.

Here’s an example: Virginia and Jason Johnston are 40 years old. They have an HDHP with a deductible of $2,600 and make their maximum 2016 yearly contribution to an HSA of $6,750. They don’t have a lot of medical needs, even with two young kids, and decide on the following investment strategy:

(Note: Please consult with a professional before investing. Rates of return may vary, and loss of principal in buckets 2 and 3 is possible.)

Here’s how the Johnstons might use this approach:

In Year 1, they put $3,375 in Bucket 1 (to cover one to two years of health care expenses, if needed), $843 in Bucket 2 and $2,532 in Bucket 3.

After Year 1, each year they put 25% of their contributions in Bucket 2 and 75% in Bucket 3. If Bucket 1 is used up, it is replenished by contributions or from Bucket 2, and if Bucket 2 is used up, it is replenished by contributions or from Bucket 3.

Here’s an example of the growth potential: If the Johnstons make no distributions from any buckets (because they are able to pay medical expenses through other sources), the three buckets could potentially have more than $400,000 in 25 years, by the time they are 65:

(Note: Assumes a total of $6,750 contributed every year and yearly compounding.)

According to the Employee Benefit Research Institute, the cost of health care in retirement for a 65-year-old couple in poor health could easily top $300,000. If you have the need for long-term care, the costs can go even higher.

With health care costs rising, having access to a large sum that can be used tax-free for health care in retirement and for general retirement funding while paying ordinary income tax is a fantastic option.

It will take a little work to safely integrate a higher-risk HSA into your health care and retirement plan, but your 65-year-old self will thank you.

Mark Struthers, CFA, CFP, is a fee-only planner with Sona Financial in Chanhassen, Minnesota.

The article Investment Advantages of Health Savings Accounts originally appeared on NerdWallet.