Life as a member of the British Royal Family seems glamorous from the outside looking in. Extravagant weddings, high-profile appearances at public events and taking up residence in palatial estates certainly cost a great deal of money.

But where, exactly, does that money come from, and how much is someone like Prince Harry worth?

For both Princes Harry and William, the answer to the first question is the same: Their mother. Princess Diana’s will left a sum of $21.3 million after taxes to her sons, to be paid out to each of them after their 25th birthdays. A large portion of her $35.6 million estate came from the divorce settlement with Prince Charles.

harry salary
Prince Harry waves as he leaves Nottingham's new Central Police Station on October 26, 2016 in Nottingham, England. Joe Giddins - WPA Pool/Getty Images

Since Prince Harry turned 25, he has gotten annual dividends of roughly $420,000 in U.S. dollars. Both of Diana’s sons also inherited her jewels, though the exact value of those is unknown.

The princes also get money from the Duchy of Cornwall, a private estate currently belonging to Prince Charles and his kin. The Duchy of Cornwall made around $28 million from real estate in a recent fiscal year, according to CNN.

Aside from that, Prince Harry got a salary for his years in the Army, too. He had a salary of roughly between $40,000 and $50,000 in the current exchange rate. He served in the Army for ten years, starting in 2005, so he made money for a decade doing that, as well.

In total, Prince Harry’s net worth is estimated to be anywhere from $25 million to $40 million, according to Time. Between his inheritance, his money from his service in the Army and the money he gets from the Duchy of Cornwall, it is safe to say both he and Meghan Markle will be able to care for their baby when it is born in the next few months.