SAN FRANCISCO (Reuters) - Snap Inc’s initial public offering filing seemed to show a company with a basic math problem: the company’s cost of revenue for 2016 - the amount it had to spend just to keep the messaging service running - was $47 million higher than its $405 million in sales.

FILE PHOTO - The Snapchat logo is seen on the door of their headquarters in Venice, Los Angeles, California October 13, 2014. REUTERS/Lucy Nicholson/File Photo

The high cost of revenue, which in Snap's case consists mainly of payments to Alphabet Inc's GOOGL.O Google for hosting the service, means that, on an annual basis, Snap lost money on every one of its 158 million users in 2016, even before accounting for salaries, office rents or anything else.

Snap revealed in its IPO prospectus, filed with securities regulators on Thursday, that it will pay Google at least $2 billion over the next five years.

But the cost side of the problem may not be as serious as it seems. The company's hosting costs are broadly in line with other social media companies. Its cost of revenue per active daily user was 97 cents in the last quarter of 2016, not much higher than the 85 cents that Facebook Inc FB.O paid for each of its 1.23 billion daily users in the final quarter of 2016.

Further, while Snap’s cost of revenue was higher than sales on a yearly basis in 2016, the company drastically tightened up hosting costs over the course of the year. While costs were nearly double revenues at the start of the year, by the fourth quarter, when Snap hit 158 million users, the company eked out a small gross margin.

Snap’s bigger math problem is how much revenue it generates per user. The $1.05 per user for the last quarter of 2016 was a massive increase from the 31 cents per user it drew in the same period in 2015. In its IPO filing, Snap said it hopes to increase its revenue per user by focusing on more lucrative advertising markets, like North America, where its revenue per user was $2.15 at the end of 2016, nearly double the global rate.

But even those higher rates for Snap pale in comparison to the $7.16 in revenue per user that Facebook brought in in the fourth quarter.

“Snap’s issue is not cost, but user growth and revenue per user,” said Ethan Kurzweil, a venture investor with Bessemer Venture Partners who backed startups such as Twitch and Periscope but has not backed Snap. “If they can get revenue per user into the kind of territory they think is possible, the cost of hosting will be a hit to gross margin but it’s not going to be an issue.”

Facebook provides the example. Even though its cost per user rose 7.4 percent between the last quarter of 2016 versus a year earlier, its revenue per user grew at a much faster 27.5 percent, a difference that helped drive its $10.2 billion in profits for the full year.

All of that does, however, mean that Snap has little leeway in delivering dramatic revenue growth in light of the high underlying cost of delivering all those pictures and videos.

The cost of revenue figure, noted analyst Brian Wieser at Pivotal Group, “was notable for what it indicates about the expense of running Snap.”