Converting the entire U.S. power grid to 100 percent renewable energy in the next decade is technologically and logistically attainable, and would cost an estimated $4.5 trillion, according to a recent analysis by the energy research firm Wood Mackenzie. That’s nearly as much as the United States has spent on the war on terror since 2001.

The estimate represents the cost of replacing all fossil fuels and nuclear power with hydroelectricity, biomass, geothermal, wind, and solar. The price tag would drop to $4 trillion if nuclear were allowed to remain part of the energy mix, Greentech Media reports.

To achieve 100 percent renewable energy over the next 10 years, the analysis finds that there would first have to be a massive buildout of wind and solar capacity, costing $1.5 trillion. Next, the U.S. would need to add 900 gigawatts of battery storage, raising the price tag to $4 trillion. Lastly, the U.S. would need to double its transmission lines — from 200,000 miles today to 400,000 miles — to handle the new distributed power system, costing another $700 billion.

The estimate is based on current technology and does not factor in future innovation, according to Greentech Media. Analysts at Wood Mackenzie also found that the $4.5 trillion price tag stays the same whether the U.S. completes the transition in 10 years or 20.

“Total price tag is not dependent on timeline, just the cost per year, as we are assuming current technology,” said Dan Shreve, Head of Global Wind Energy Research at Wood Mackenzie and one of the authors of the report.