using System; using System.Collections.Generic; public class Hello{ public static void Main(){ int price1 = int.Parse(Console.ReadLine()); int price2 = int.Parse(Console.ReadLine()); var loss = price2 + price1; int N = int.Parse(Console.ReadLine()); var room = new HashSet(); for(int x = 0;x < N;x++){ int input = int.Parse(Console.ReadLine()); room.Add(input); } var ans = loss * (N - room.Count); Console.WriteLine(ans); } }