using System; using System.Collections.Generic; using System.Linq; public class Amatsuki{ public static void Main(){ var cost = int.Parse(Console.ReadLine()); cost += int.Parse(Console.ReadLine()); var roop = int.Parse(Console.ReadLine()); var roomList = new List(); for(var i = 0; i < roop; i++){ roomList.Add(Console.ReadLine()); } var duplicate = roomList.Count - roomList.Distinct().Count(); Console.WriteLine(duplicate * cost); } }