After a gruesome reelection campaign, President Obama should unwind. And instead of playing basketball, he should watch a movie. How about the 2007 biographical drama, “Charlie Wilson’s War”? It’s about the period when the United States was leaving Afghanistan after wrapping up its covert anti-Soviet operation there. Tom Hanks, who played the role of Congressman Charlie Wilson in the movie, pleaded with lawmakers, “$1 million for school reconstruction. … Did you hear me say? It was a million, not a billion, for a school construction?”

This is what he got in return: “Nobody gives a sh** about a school in Pakistan.” Or Afghanistan.

Caution: A quarter century later, America is about to make the same mistake. President Obama and Mitt Romney both pledged to leave Afghanistan by 2014. But neither discussed the importance of establishing schools for the children of a war torn nation where nearly half the population is now under the age of 15.

As the recent Taliban assassination attempt on Malala Yousafzai, the 15-year-old Pakistani champion of girls’ education, shows: The Taliban are most scared of books, not bombs. Establishing an educational infrastructure in Afghanistan is the most cost effective long-term strategy for grassroots change.

The cost effectiveness could be shown in multiple ways. “For the cost of just one soldier in Afghanistan for one year, we could start about 20 schools,” said Nicholas Kristoff in a July 2010 column in the New York Times.

Kristoff says Greg Mortenson, the author of “Three Cups of Tea,” told him that “for the cost of just 246 American soldiers in Afghanistan for a year, we could pay for a higher education plan for all Afghanistan.”

Can you imagine the global impact of educating a tribal society over the next decade, all for less than 0.1 percent of our annual military spending?

“Why build,” some push back, “when the Taliban are going to destroy these schools anyway?” Again, ask Greg Mortenson who reported that the Taliban have not destroyed even one of his schools.

To be fair, the U.S. government has made some strides. In December 2011, an Afghan version of “Sesame Street” — a program funded by the U.S. State Department and produced in consultation with Afghanistan’s Ministry of Education — was launched. Afghanistan has one of the highest proportions of school-age children in the world, yet less than half are in school.

This leaves millions of young Afghans, mostly girls and women, vulnerable to poverty and Taliban influence. As the U.S. withdraws its troops and the Taliban regain control, which they will in varying degrees, they are likely to enforce misogynistic policies with impunity and recruit 14-year-olds for suicide bombings.

Some will blame Islam itself for this inhumanity. But their reasoning doesn’t hold up. Why don’t American Muslims blow themselves up? Primarily, because such acts of cowardice are an affront to Islam and its prophet. But they have this understanding because they are educated. They have a good life. They have plans for tomorrow. For an Afghan kid, it’s different.

About 12,000 Afghan civilians were killed just between 2007 and 2011. Think about their orphan children who could be recruited by a Taliban run madrassah (school) to fight in “God’s army against the infidel.” This army is funded in part by Saudi oil money to nurture the extremist Wahhabi and anti-western mindset in the religious madrassahs. In the 1980s, the Saudis matched America’s anti-communism budget of $500 million to uproot the Soviets in Afghanistan. Now, their motivations for funding the Taliban are different.

Helping Afghanistan establish schools today, Mr. President, would prevent American lives tomorrow. It shouldn’t be this way. But sadly, it is.

Before declining to help the Afghans, we should remember that the Taliban have other help anyway — notably from the Pakistani Army, politicians and mullahs. Recently, even a relatively liberal ex-cricketer-turn-Pakistani-politician, Imran Khan, publicly gave legitimacy to their cause by declaring the Afghan conflict “a holy war” justified by Islamic law. Ignore this paradigm of support, and America’s decade-long gains will be washed away within a year.

“This is what we always do. We always go in, with our ideals to change the world. And then we leave. We always leave,” Charlie Wilson lamented. Mr. President, regarding Afghanistan, please don’t display the body language of a leader who just wants to leave.

Before leaving Afghanistan, Washington should pledge at least $1 billion to establish secular schools for boys and girls in Afghanistan. And policymakers should work with Islamabad to help fund and establish schools in the tribal areas of Pakistan. The funds should go toward hiring qualified teachers, developing standardized curricula, and constructing a robust infrastructure to support these schools, their staff and their students. If armed protection for such schools is required, it should come from locally hired forces.

Spent right, these dollars could achieve what counterinsurgency missions, bombers and drones could not.