Context: The film begins some years in the future from this exact moment. We see ads everywhere (buildings, walls, bus stops, e.t.c) for the hit game Slayers, and how the star character Kable (Gerard Butler) has four battles left before he earns his freedom. We are then shown a battle in progress: a massive shootout inside a factory. Everyone in the game is controlled by players elsewhere. Characters get points for each kill and for saving a teammate. Some characters are shown to be doing menial tasks in the battlefield, seemingly unaware of all the violence around them. 17-year-old Simon (Logan Lerman) plays/controls Kable and leads him around the factory. After slaughtering most everyone in his way, Kable gets blasted outside of the factory. Kable manages to run to the safe point to win the battle. Afterward, the surviving characters are transported elsewhere. The other characters congratulate Kable on winning, since he now only has three battles left until freedom. Some of the other characters don't believe that anyone will be released from the game.The producer (Michael Weston) and Chief of Staff, Bob, (John de Lancie) for the Gina Parker Smith Show discuss their next guest for the show - genius recluse Ken Castle, the creator of Slayers. On the show, Gina (Kyra Sedgwick) talks about the achievements of Ken Castle (Michael C. Hall). He first created a game called Society, which is basically a Sims game but instead of controlling a fake character, the players control a real person and can make them do whatever they want. You can pay to control someone else, or you can get paid to be controlled. Society quickly became extremely popular and profitable, making Castle the richest person in the universe. Nine months ago Castle created Slayers, a controversial game which is supported by the federal government. Castle defends Slayers by stating that each character in the game, though they are real people, are all death row inmates who chose to sign up for the game instead of doing their prison sentence. If a convict can stay alive for thirty battles, they will be set free (though no one has ever survived that long). Some convicts are sent into battlefields with pre-engineered actions to do, and will be set free if they survive just one battle, but are unable to defend themselves (which makes their death rate extremely high). Also, the games are all televised on pay-per-view. Everyone in Slayers and Society has had nano-cells implanted into their brains, which makes it possible for them to be controlled by someone else. They can only be controlled in the perimeter of the game (meaning after the game is over, they get their control back).After the show is over, the signal is hacked into by Humanz, a resistance group. The Humanz Brother (Ludacris) condemns Castle and states that eventually we will all be his slaves if we continue down this road. Castle gets a kick out of it and has his men try to locate where the signal came from. In prison, a convict beats a guard to death and tries to escape but in the end, he fails. Kable sits by himself and thinks about his family. Freek (John Leguizamo) sits next to Kable. He talks about how Kable spooks everyone else when he sits by himself and is constantly thinking. He can't believe that Kable only has three battles left. Freek asks him why he's in prison. Kable has a quick flashback of a man bleeding in a room. Later on, while sitting in his cell, someone opens the slot of the door and hands Kable a picture of his wife and child. The female voice on the other side knows that his family is the only thing he fights for. She makes Kable sign an autograph for her son, David, and then takes a blood sample from his hand as proof of authenticity to increase the value of the autograph.Elsewhere, we see Kable's wife Angie (Amber Valletta) going to work as a character in Society. Practically all the game characters are dressed in ridiculous and skimpy costumes 
 Question: How many matches does an inmate have to survive to gain freedom?
Output: 30