774
Most of the world's biggest advertisers have stopped buying ads on Elon Musk's X, exclusive new data shows
(www.businessinsider.com)
This is a most excellent place for technology news and articles.
I don't think the exact amount is known, but he got money from a lot of sources and the bulk of it was Elon's own money (or at least, his own assets). He also sourced a lot of money from other American billionaires (Larry Ellison for example).
It's likely the Saudis invested very little... although they did invest enough that Elon has to have given them something in return.
Nobody involved in that purchase expected to make money on it. The price was far too high.