Let’s stipulate right at the top that watching your retirement investments fall in value is painful, fear-inducing, and no one’s idea of a good time. And it can feel especially intense if you are 35 or younger, as this is likely the first bear market you have experienced as an investor, not a bystander.

But keeping your eye on your ultimate goal — retirement that is 30 or more years off — can recast today’s bear market as an opportunity.

Right now you are in what policy wonks call the retirement accumulation phase. That is, you are piling money into stocks (and some bonds) for future use. When you retire you will switch gears and find yourself in the decumulation phase. You will pull money out to live on.

When you are in the accumulation phase, bear markets deliver an important deal: Stocks go on sale, allowing you to buy more shares for the same dollar amount.

Let’s say you own a low-cost stock index fund that had a $10 share price and you had $100 to invest. That means you can buy 10 shares. If a bear market sends the share price to $6.50, you could buy more than 15 shares with your $100.

If we can agree that at some point stocks will recover and the share price of your index fund gets back to $10 a share, your 10-share investment will be worth $100 (back to break even). The 15 shares you bought when prices were on sale are now worth $150. That’s the accumulation phase opportunity. Buy cheaper shares today with the expectation that sometime in the future stocks will rebound.

So when will stocks recover? Who knows? The bear market that began in February is the 13th since 1946. The average loss is around 33%, according to CFRA Research, and the decline typically lasts for about a year. From there it can take two years for stocks to make back what they lost.

Sure, in the short term, shares you buy now could become even cheaper if this bear market persists. That’s OK. Keep reminding yourself you don’t need this money for another 30 or 40 years, or more.

A trip in the way-back machine might help set the scene. The 1970s was a lousy time to invest. A bear market that began in January 1973 and ran through the fall of 1974 saw U.S. stocks plunge more than 40%.

Let’s imagine a 30-year-old invested $10,000 on Jan. 1, 1973, in U.S. stocks, for her retirement at age 65. By the end of that bear market, the portfolio value was down to around $5,500. If ever there was a time to think that stock investing was doomed, that was it.

But let’s say our 30-year-old remained patient. By the time she was 65, in the fall of 2008, that $10,000 she had invested back in 1973 just as that bear market took hold would be worth nearly $300,000. If, however, she bailed on stocks at the bottom of that bear market and moved the $5,500 she had in stocks into an interest-bearing cash instrument, by the time she was 65 her cash would have been worth about $41,000.

One big difference between then and now is that many workers back then weren’t responsible for their retirement savings as old-fashioned pensions were much more popular.

Today’s workers know their future retirement security is riding on choices they make today. And in a bear market those choices can begin to feel really uncomfortable. Deep breath. Remind yourself you are not investing for next year or the year after. Your goal is decades away. This bear market, and future ones, are an opportunity to buy more shares when they are at lower prices.