In other words, like if Elon Musk wanted to buy a country, how much would it cost him?

Total value that would be almost entirely destroyed in the event of a major nuclear conflict...
A reasoning in first approach would be to add the GDP since the creation of this country (not easy with old countries like in Europe, especially since the GDP is a post-industrial notion....)
But we should add (at least):
a) Present and future human resources
b) Public, economic, agricultural, real estate and industrial heritage, including intellectual and cultural property (included in GDP but subject to speculation, etc.)
It should be subtracted (at least):
a) Foreign debts
b) Foreign properties and assets (including everything related to finance and stock exchanges)
Here, here, you have 2 hours! Good luck !

(by searching one can perhaps find the answer on the internet, I would be surprised that such an important question has not been the subject of economic studies...)