When the whirlwind of the Winter Olympics spins to a close this weekend, the host city, Pyeongchang, South Korea, will settle down to a life beyond aerial flips, halfpipe pretzels and metronomic North Korean cheerleaders. The place will become, once again, a quiet spot where very few children live — its population a disproportionately elderly one, dependent on an imperiled social-security system. Pyeongchang played a happy Olympic host, but its everyday economic reality highlights an existential threat shadowing South Korea. It’s not (or not only) the North Korean missiles and nuclear weapons arrayed across the border just 50 miles away. The more intractable danger is a demographic time bomb already starting to detonate across South Korea and all over East Asia.

Japan, with its shrinking population, has long been the region’s pace setter for demographic doom. But South Korea’s fertility rate has plummeted to one of the lowest in the world, barely more than one child per woman. Throw in rising life expectancy, and South Korea is now aging faster than any other advanced economy on Earth. Between 1975 and 2015, its median age soared to 41.2 from just 19.6. In Gangwon, the potato-growing province that encompasses Pyeongchang, the median age is expected to pass 60 by 2045. (The median age in the United States, now 37.9, is predicted to creep up to 42 by 2045.) Thousands of South Korean schools have already been abandoned for lack of students.

The economic fallout of this demographic shift could be devastating. After transforming itself from a poor, war-ravaged agricultural society into a manufacturing giant in just a few decades, South Korea now faces one peril of prosperity: a labor shortage that will be a drag on both the economy and the pension system for its aging residents. Like the rest of East Asia, Seoul has tried to increase birthrates, offering child care bonuses, fertility treatments, even gifts of beef for families with newborns. Some of its efforts, though, come across as little more than pressuring women to marry and reproduce. In one instance, the government published (and then retracted) an online “birth map” that showed, in shades of pink, the number of women of childbearing age by city and region.

Failing in its push, South Korea opted to pull. It has brought in — cautiously, but still much more actively than China or Japan — a growing number of foreign migrants. Back in 1990, the country was so insular that it had fewer than 50,000 foreign nationals. Today there are more than two million, a 40-fold increase, most from China, Vietnam and other parts of Southeast Asia. “What other options are there?” says Mihyung Park, the head of the South Korea office of the International Organization for Migration. “The South Korean economy cannot function without foreign workers.”