MANY developed countries have anti-immigration political parties, which terrify the incumbents and sometimes break into government. Lithuania is unusual in having an anti-emigration party. The small Baltic country, with a population of 2.8m (and falling), voted heavily in 2016 for the Lithuanian Farmer and Greens’ Union, which pledged to do something to stem the outward tide. As with some promises made elsewhere to cut immigration, not much has happened as a result.

“Lithuanians are gypsies, like the Dutch,” says Andrius Francas of the Alliance for Recruitment, a jobs agency in Vilnius, the capital. Workers began to drift away almost as soon as Lithuania declared independence from the Soviet Union in 1990. The exodus picked up in the new century, when Lithuanians became eligible to work normally in the EU. For many, Britain is the promised land. In the Pegasas bookshop just north of the Neris river in Vilnius, four shelves are devoted to English-language tuition. No other language—not even German or Russian—gets more than one.

Mostly because of emigration, the number of Lithuanians aged between 15 and 64 fell from 2.5m in 1990 to 2m in 2015. The country is now being pinched in another way. Because its birth rate crashed in the early 1990s, few are entering the workforce. The number of 18-year-olds has dropped by 33% since 2011. In 2030, if United Nations projections are correct, Lithuania will have just 1.6m people of working age—back to where it was in 1950.

Lithuania was an early member of a growing club. Forty countries now have shrinking working-age populations, defined as 15- to 64-year-olds, up from nine in the late 1980s. China, Russia and Spain joined recently; Thailand and Sri Lanka soon will. You can now drive from Vilnius to Lisbon (or eastward to Beijing, border guards permitting) across only countries with falling working-age populations.

It need not always be disastrous for a country to lose people in their most productive years. But it is a problem. A place with fewer workers must raise productivity even more to keep growing economically. It will struggle to sustain spending on public goods such as defence. The national debt will be borne on fewer shoulders. Fewer people will be around to come up with the sort of brilliant ideas that can enrich a nation. Businesses might be loth to invest. In fast-shrinking Japan, even domestic firms focus on foreign markets.

The old will weigh more heavily on society, too. The balance between people over 65 and those of working age, known as the old-age dependency ratio, can tip even in countries where the working-age population is growing: just look at Australia or Britain. But it is likely to deteriorate faster if the ranks of the employable are thinning. In Japan, where young people are few and lives are long, demographers expect there to be 48 people over the age of 65 for every 100 people of working age in 2020. In 1990 there were just 17.

Some countries face gentle downward slopes; others are on cliff-edges. Both China and France are gradually losing working-age people. But, whereas numbers in France are expected to fall slowly over the next few decades, China’s will soon plunge—a consequence, in part, of its one-child policy. The number of Chinese 15- to 64-year-olds, which peaked at just over 1bn in 2014, is expected to fall by 19m between 2015 and 2025, by another 68m in the following decade, and by 76m in the one after that (see chart 1).

Jörg Peschner, an economist at the European Commission, says that many countries face demographic constraints that they either cannot or will not see. He hears much debate about how to divide the economic cake—should pensions be made more or less generous?—and little about how to prevent the cake from shrinking. Yet countries are hardly powerless. Even ignoring the mysterious business of raising existing workers’ productivity, three policies can greatly alleviate the effects of a shrinking working-age population.

Never done

The first is to encourage more women to do paid work. University-educated women of working age outnumber men in all but three EU countries, as well as America and (among the young) South Korea. Yet female participation in the labour market lags behind men’s in all but three countries worldwide. Among rich countries, the gap is especially wide in Greece, Italy, Japan—and South Korea, where 59% of working-age women work compared with 79% of men.

Governments can help by mandating generous parental leave—with a portion fenced off for fathers—to ensure that women do not drop out after the birth of a child. And state elderly care helps keep women working in their 50s, when parents often become more needy. But a recent IMF report argues the greatest boost to recruiting and keeping women in paid jobs comes from public spending on early-years education and child care.

Employers can do more too, most obviously by providing flexible working conditions, such as the ability to work remotely or at unconventional hours, and to take career breaks. Fathers need to be able to enjoy the same flexible working options as mothers. Some women are kept out of the workforce by discrimination. This can be overt. According to the World Bank, 104 countries still ban women from some professions. Russian women, for example, cannot be ship’s helmsmen (in order, apparently, to protect their reproductive health). More often discrimination is covert or the unintended consequence of unconscious biases.

Countries can also tap older workers. Ben Franklin, of ILC UK, a think-tank, argues that 65, a common retirement age, is an arbitrary point at which to cut off a working life. And in many countries even getting workers to stick around until then is proving difficult. Today Chinese workers typically retire between 50 and 60; but by 2050 about 35% of the population are expected to be over 60. Thanks to generous early-retirement policies, only 41% of Europeans aged between 60 and 64 are in paid work. Among 65- to 74-year-olds the proportion is lower than 10%. In Croatia, Hungary and Slovakia it is below one in 20.

The levers for governments to pull are well known: they can remove financial incentives (tax or benefits) to retire early and increase those to keep working. Raising the state retirement age is a prerequisite almost everywhere; if the average retirement age were increased by 2-2.5 years per decade between 2010 and 2050, this would be enough to offset demographic changes faced by “old” countries such as Germany and Japan, found Andrew Mason of the University of Hawaii and Ronald Lee of the University of California, Berkeley.

Employers, too, will have to change their attitudes to older workers. Especially in Japan and Korea, where they are most needed, workers are typically pushed out when they hit 60 (life expectancy is 84 and 82 respectively). Extending working lives will require investment in continued training, flexible working arrangements, such as phased retirement, and improved working conditions, particularly for physically tough jobs. In 2007 BMW, a German carmaker, facing an imminent outflow of experienced workers, set up an experimental older-workers’ assembly line. Ergonomic tweaks, such as lining floors with wood, better footwear and rotating workers between jobs, boosted productivity by 7%, equalling that of younger workers. Absenteeism fell below the factory’s average. Several of these adjustments turned out to benefit all employees and are now applied throughout the company.

A final option is to lure more migrants in their prime years. Working-age populations are expected to keep growing for decades in countries such as Australia, Canada and New Zealand, which openly court qualified migrants. Others can try to entice foreign students and hope they stick around. Arturas Zukauskas, the rector of Vilnius University, thinks that he could improve greatly on the current tally of foreign students—just 700 out of 19,200. In particular, he looks to Israel, which has the highest birth rate in the rich world. Lithuania had a large Jewish population before the second world war, and many prominent Israelis have roots in the country. Partly to signal the academy’s openness, Vilnius University has started awarding “memory diplomas”, mostly posthumously, to some Jewish students evicted on Nazi orders.

The trouble is that the countries with the biggest demographic shortfalls are often the most opposed to immigration. For example, the inhabitants of the Czech Republic and Hungary view immigrants more negatively than any other Europeans do, according to the European Social Survey. Those countries’ working-age populations are expected to shrink by 4% and 5% respectively between 2015 and 2020. Countries that lack a recent history of mass immigration may have few supporters for opening the doors wider. Even if they wanted new settlers, they might have to look for them far afield. Countries with shrinking working-age populations are often surrounded by others that face the same problem.

“China has never been a country of immigrants,” explains Fei Wang of Renmin University in Beijing. It is unlikely to become one, but is trying to lure back emigrants and to attract members of the ethnic-Chinese diaspora. In February the government relaxed visa laws for “foreigners of Chinese origin”. In Shanghai, and perhaps soon in other cities, foreign-passport holders are allowed to import maids from countries such as the Philippines. That is a small step in the right direction.

Just as countries’ demographic challenges vary in scale, so the remedies will help more in some countries than in others. Take Italy and Germany. Both have shrinking working-age populations that are likely to go on shrinking roughly in parallel. But Italy could do far more to help itself. Because the women’s employment rate in Italy lags so far behind the men’s rate, its active population would jump if that gap closed quickly—and if everybody worked longer and became more educated (see chart 2). Germany could do less to help itself, and Lithuania less still.

In theory, every rich country can prise open the demographic trap. Governments could begin by lowering barriers to immigrants and raising the retirement age. They could entice more women into the workforce. They could raise the birth rate by providing subsidised child care, which would create a wave of new workers in a couple of decades, just when the other reforms are petering out. But, when a country is shrinking, many things come to seem more difficult. Earlier this year, Poland built up a large backlog of immigration applications, many of them from Ukrainians. It turned out that the employment offices were badly understaffed, and could not process the paperwork in time. They had tried to take on workers, but failed.