Comcast's failed bid to merge with Time Warner Cable was a long shot, one that ultimately costs both companies a considerable amount of money.

In its quarterly earnings report out today, Comcast revealed it burned $99 million during the first quarter in what it called transaction-related costs. As Ars Technica notes, this is in addition to the $99 million it spent in the fourth quarter of last year, $77 million in Q3 2014, $44 million in the second quarter and $17 million in Q1 2014.

That means that Comcast has spent $336 million over the past five quarters trying to get the deal approved.

Comcast VP of Government Communications Sena Fitzmaurice told the publication that the costs are mainly for legal fees and outside consulting firms which includes everything from Human Resources and IT consulting to banks and management consulting services.

Time Warner, meanwhile, has recorded acquisition charges of more than $200 million which includes tens of millions of dollars spent to retain employees.

Comcast CEO Brian Roberts said his company structured the transaction in such a way that it avoided unnecessary risk for shareholders in the event the regulatory outcome didn't go their way. Roberts is of course referring to AT&T's hefty breakup fee to T-Mobile when that deal was called off over regulatory concerns.  AT&T had to hand over $3 billion in cash and another $1 billion in spectrum licenses.

Image via Bloomberg News