Image caption The rescue effort involved running three drilling operations at once at the San Jose mine

Following the triumphant rescue of 33 miners trapped for 69 days beneath the Chilean desert, the country's authorities must now count the cost of the massive operation.

Chile's President Sebastian Pinera puts it at somewhere between $10m and $20m, but has reminded reporters that "every peso was well spent".

Witnessing the faces of the miners as they finally escaped their underground prison, few would argue with that.

But that has not stopped the government from trying to recover at least some of the cost from the owner of the collapsed mine, the San Esteban Primera mining company.

"The government has already taken legal action against the assets and shareholders of the mine," said Rodrigo Hinzpeter, Chile's interior minister on Wednesday, according to the Chilean newspaper La Tercera.

That may not be as straightforward as it sounds.

Drilling expertise

San Esteban Primera is currently in danger of being declared bankrupt after admitting that huge debts and the financial impact of the San Jose mine's closure have hit it hard.

Image caption Private companies pitched in with specialist equipment such as the Schramm T130 drill

An audit of the company is currently being conducted to decide how best to pay its creditors back.

In its absence, it is the state-run Codelco mining firm that has led the rescue effort, and contributed the bulk of resources.

Press reports from Chile suggest the copper mining giant has spent up to $15m on the rescue, while private companies have borne up to $5m of the cost.

The main expenditure has been on machines and equipment used for the massive drilling operation that began at the end of August.

There was also the need for sophisticated communications equipment to be installed, owing to the mine's relatively remote location, as well as the sheer number of man-hours put into the rescue effort.

A number of mining giants had parts to play in the rescue.

They included BHP Billiton and Collahuasi company - the privately-owned joint venture between the UK-listed miners Anglo American and Xstrata - which supplied both drilling expertise and equipment.

Collahuasi can take credit for supplying the Schramm T130 drill that eventually bored the miners' escape hole, along with the drilling experts from another company, GeoTech Drilling, who knew how to use it to drill a precision hole.

One drilling expert even flew from an operation in Afghanistan to lend a hand, and help prevent the drill from "walking", keeping the drill shaft straight so that the rescue capsule could move through it smoothly.

Oakley coup

Another company, Maptek, was used to map the complex underground network of tunnels and help target the rescue shafts.

Despite the remarkable group effort, the mining companies appear to have kept their involvement in the rescue relatively low-key.

In contrast, US sunglasses maker Oakley stands to benefit from a much more high-profile contribution.

They donated 35 pairs of sunglasses, usually sold for about $200 each, to protect the miners' eyes on their return to the surface.

And according to research by US research firm Front Row Analytics, the worldwide minute-by-minute coverage of the rescue has seen Oakley net the equivalent of $41m in television advertising time.

For mining companies, their future in Chile is less certain. Publicly-owned Codelco faces the threat of being broken up under the now-hugely popular President Pinera.

A renewed emphasis on mining safety may also squeeze the big private miners further, with a tax hike on foreign miners operating in the country already planned.