Let’s stipulate right at the top that watching your retirement investments fall in value is painful, fear-inducing, no one’s idea of a good time. And it can feel especially intense if you’re 35 or younger, as this is likely the first bear market you’ve 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’re 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’ll pull money out to live on.

When you’re 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, and then move on to new highs, before the next bear market arrives.

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. History has shown us that over the long term, the bull market gains outweigh the bear market losses, for those who remain patient and stay invested. What you buy today is going to be worth a whole lot more in 20, 30, 40 years. Given modern life expectancies, savers need a very long-term focus.

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. Ask anyone who was an adult in the 1970s and they will tell you what a rough financial slog it was. An oil embargo was squeezing the economy and inflation was a huge problem, and, oh yeah, President Nixon resigned under threat of impeachment. 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, $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.

Even if we extend her time frame to take in all of the 2008-2009 bear market, the $10,000 would have been worth more than $180,000 in March 2009 when the financial crisis bear market ended.

Clearly, staying invested paid off. Moreover, continuing to invest through it all was the big win. Let’s say our 30-something back in 1973 not only invested $10,000 in U.S. stocks, but also committed to investing another $100 a month. At the end of the 2009 bear market — which would have been her sixth bear — her portfolio would be worth around $700,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. The 401(k) or other defined contribution plan you may have through work didn’t even exist until the 1980s.

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. Just keep doing what you’ve been doing – and resist the temptation to withdraw retirement money before retirement — and you are actively making a choice to stay committed to building retirement security.

Carla Fried is a freelance personal finance journalist. Distributed by Tribune News Service.