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 roomCount = int.Parse(Console.ReadLine()); var roomList = new List(); for(var i = 0; i < roomCount; i++){ var newRoom = Console.ReadLine(); if(roomList.Contains(newRoom)){ roomList.Add(newRoom); } } Console.WriteLine(cost * (roomCount - roomList.Count)); } }