static void Main(string[] args) { string s = Regex.Replace(Console.ReadLine(), @"[^\u0020-\u007E]", string.Empty); string[] inputs = s.Split(' '); int L = int.Parse(inputs[0]); int C = int.Parse(inputs[1]); int N = int.Parse(inputs[2]); Game game = new Game(L, C, N); for (int i = 0; i < N; i++) { int Pi = int.Parse(Console.ReadLine()); game.AddGroup(i, Pi); } Console.WriteLine(game.GetProfits()); }