There's not a lot of upside to getting fired from your job, unless you're an NFL coach. Then there's a huge upside: You get to keep all the money in your contract.

Unlike players, coaches are generally given a fully guaranteed contract, which means they're paid for the duration of the contract, even if they get canned.

In the case of Chip Kelly, the fired 49ers coach has basically struck gold ... twice.

Let's start with Kelly's career in Philadelphia. When the Eagles hired Kelly in 2013, they gave him a five-year, $32.5 million deal that paid him roughly $6.5 million per year.

After three seasons, the Eagles decided they didn't want Kelly anymore, so they fired him with two years and $13 million left on his contract, meaning they still owed him $6.5 million for the 2016 and 2017 seasons.

The good news for the Eagles is that most contracts include offset language, which means they didn't have to pay Kelly his full total if someone else was paying him, and that someone else turned out to be the 49ers in 2016.

In January, Kelly signed a four-year, $24 million deal that was worth $6 million annually. With the offset language, that means the 49ers paid him $6 million and the Eagles paid him $500,000 in 2016.

In 2017, it's possible that Kelly could be collecting money from three different NFL teams. If the 53-year-old gets hired as a coach in 2017 (or an assistant coach), then Kelly will be getting pay checks from nearly 10 percent of the NFL (three out of 32 teams would be paying him, which is a total of 9.4 percent).

No matter what, Kelly will get at least $6.5 million in 2017 because that's what he was due for the final year of his Eagles' deal. The only thing that's not clear is who will be forking that money over. As ProFootballTalk.com noted over the weekend, there's not much precedent when it comes to a situation like this. The 49ers and Eagles both owe him money for 2017 and they'll likely have to ask the league office who's responsible for the bulk of Kelly's salary next season.

Being fired has made Chip Kelly a rich man. USATSI

If Kelly were to sign as an offensive coordinator somewhere for $1 million in 2017, that would be $1 million the 49ers and Eagles don't have to pay him. If Kelly doesn't sign with anyone for 2017, he'll make $6.5 million from the Eagles and 49ers combined next season.

If he stays out of football after that, the 49ers would have to pay him $6 million to do nothing for the 2018 and 2019 seasons.

Basically, if Kelly takes the next three years off, he'll still make $18.5 million. It's nice work, if you can get it.

The 49ers have just been throwing away money lately. Between Kelly and Jim Tomsula -- along with their coaching staffs -- and the firing of general manager Trent Baalke, the 49ers will pay fired members of their organization an estimated total of $69 million to not do anything for the team.