The boys from Compton smashed opening weekend expectations, while the stylish “The Man From U.N.C.L.E.” struggled to find its footing. Universal’s N.W.A. biopic earned an astonishing $56.1 million in its debut, according to studio estimates Sunday. Director F. Gary Gray’s well-received film charts the formation and rise of the influential rap group. It cost just $29 million to produce. N.W.A. members Dr. Dre and Ice Cube served as producers on the film, which has Ice Cube’s real son O’Shea Jackson Jr. playing his father. Dr. Dre also released the companion piece “Compton,” – his first new album in 16 years. Nick Carpou, Universal’s president of domestic distribution, said they were “elated” with the results. Universal had previously predicted a very conservative $25 to $30 million opening. “It really struck a chord with audiences. It’s a story that is resonating right now,” said Paul Dergarabedian, Rentrak’s senior media analyst. “It was one of those records that was an important work and a very important expression of a particular viewpoint. To this day, that album has so much power.” Beyond the fandom around N.W.A. and the timeliness of the themes, Universal also launched a clever marketing campaign around the film, “Straight Outta Somewhere,” which allows social media users to insert photos in the iconic “Straight Outta Compton” album cover and write in a hometown of their choosing. There have been over 5.4 million downloads to date and it trended No. 1 across Facebook, Twitter and Instagram for two days in a row. “We’ve got the best marketers in the business and they understand their audiences,” Carpou said. “The good news here is it attaches to a product that we’re exceedingly proud of.” According to exit polls, audiences for the R-rated film were evenly divided between genders, 51 percent were under the age of 30, 46 percent were African-American and 23 percent Caucasian. “Straight Outta Compton” is Universal’s sixth film to open over $50 million in 2015 and broke the August record for an R-rated opening. “If you were to create a blueprint for how to perfectly execute a box office year, they’ve done it,” said Dergarabedian. 1. “Straight Outta Compton,” $56.1 million ($15,000 international). 2. “Mission: Impossible – Rogue Nation,” $17 million ($46.1 million international). 3. “The Man From U.N.C.L.E.,” $13.5 million ($12 million international). 4. “Fantastic Four,” $8 million ($16.2 million international).