Last week, I attended a teacher’s conference in Orlando, Florida. They asked me to speak about saving and investing. Many of the teachers were young.

I spoke to those teachers, often one-on-one. We talked about issues faced by all young people–not just teachers. College costs, once reasonable, are now priced through the roof. Student loans hurt. Defined benefit pensions, once robust, are melting faster than polar ice caps. In their place, many of the teachers are stuck with high-cost variable annuities for their retirement (courtesy of poor decision making at their school district levels).

Today, Social Security hums. But it’s not as well funded for the next generation. Meanwhile, retail marketers have mastered an art. Many convince young people to buy (often borrowing money) for things that they really don’t need. Credit card companies are scooping souls. Home prices, in much of the country, are completely out of reach for new homebuyers.

“At least my investments are rising,” said a young teacher at the conference. But is that what she needs?

Young people who began to invest at the beginning of 2009 have seen the U.S. stock market increase by 178 percent to July 15, 2016. That’s a compound annual return of 15 percent for seven and a half years. But Warren Buffett once wrote, “Prospective purchasers [of stock market investments] should much prefer sinking prices.”

William Bernstein, the former neurologist turned financial advisor, says investors in their 20s or early 30s should “pray for a long, awful [bear] market.” He wrote, If You Can, a short ebook about investing for Millennials. In it, he explains that when stocks drop, investors pay less for a greater number of shares. By dollar cost averaging, such investors can stockpile assets. When the markets eventually recover, those asset values soar.

It’s easier to think of stocks as cans of non perishable food. Workers buy these cans and stuff them in the cellar. Once retired, they eat that food. If the price of those items rises rapidly after they retire, the retirees can celebrate. After all, they’ve already bought their cans.

That isn’t the same for young investors. They’re in the collecting phase. They get less for their money when prices rise quickly.

We can’t control stock market levels. But we can control how we feel about market prices. Young investors should smile–and keep investing–when stocks don’t rise.

Imagine a young investor named Lucy. She starts her career at age 22. She invests every year. Over the next 30 years, should Lucy prefer to see stocks rise by a compound annual return of 15 percent annually for 15 years, followed by an equal time period when stocks average a compound annual return 2 percent? Or should she prefer stocks to compound annually at 2 percent per year for the first 15 years, followed by 11 percent per year for the next 15 years?

Instinctively, most people would choose option 1, preferring to see investment gains right away. After 30 years, that would give Lucy $922,817.99. But Warren Buffett and William Bernstein are right. Young investors benefit when markets are weak. The second option would be better. With it, Lucy’s money would grow to $1,235,866.87.

$10,000 Invested Annually

Year Scenario 1
Stocks Gain 15% Per Year For 15 Years, Followed by 2% Per Year For 15 Years
Scenario 2
Stocks Gain 2% Per Year For 15 Years, Followed by 11% Per Year For 15 Years
Acct. Balance Compound Annual Growth Rate Acct. Balance Compound Annual Growth Rate
$10,000.00 $10,000.00
1. $21,500.00 15% $20,200.00 2%
2. $34,725.00 15% $30,604.00 2%
3. $49,933.75 15% $41,216.08 2%
4. $67,423.81 15% $52,040.40 2%
5. $87,537.38 15% $63,081.21 2%
6. $110,667.99 15% $74,342.83 2%
7. $137,268.19 15% $85,829.69 2%
8. $167,858.42 15% $97,546.28 2%
9. $203,037.18 15% $109,497.21 2%
10. $243,492.76 15% $121,687.15 2%
11. $290,016.67 15% $134,120.90 2%
12. $343,519.17 15% $146,803.32 2%
13. $405,047.05 15% $159,739.38 2%
14. $475,804.11 15% $172,934.17 2%
15. $557,174.72 15% $186,392.85 2%
16. $578,318.22 2% $216,896.07 11%
17. $599,884.58 2% $250,754.63 11%
18. $621,882.28 2% $288,337.64 11%
19. $644,319.92 2% $330,054.78 11%
20. $667,206.32 2% $376,360.81 11%
21. $690,550.45 2% $427,760.50 11%
22. $714,361.45 2% $484,814.15 11%
23. $738,648.68 2% $548,143.71 11%
24. $763,421.66 2% $618,439.52 11%
25. $788,690.09 2% $696,467.87 11%
26. $814,463.89 2% $783,079.33 11%
27. $840,753.17 2% $879,218.06 11%
28. $867,568.23 2% $985,932.05 11%
29. $894,919.60 2% $1,104,384.57 11%
30. $922,817.99 2% $1,235,866.87 11%

How about a constant annual compound return of 7 percent over 30 years? It would be easier on the nerves. Instinctively, it also looks better than facing weak stock returns for the first 15 years. But the market laughs at instinct. This third scenario would see that money grow to $1,020,730.41. Facing the first 15 years of horrible returns, followed by 11 percent per year, would provide $215,136.46 more.

Nobody can control defined benefit pensions, home prices, stock prices or the state of Social Security. But young people can control their behavior and perspective. They shouldn’t be afraid to invest when the markets sputter.

Instead, they should invest every month–and smile when markets lag.