import java.util.*; import java.util.stream.Stream; import java.time.*; import java.time.format.*; public class No586 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int lost = sc.nextInt() + sc.nextInt(); int n = sc.nextInt(); int[] r = new int[n]; int count = 0; for(int i = 0; i < n ; i++) { r[i] = sc.nextInt(); } Arrays.sort(r); for(int i = 0; i < n - 1; i++) { if(r[i] == r[i+1]) { count++; } } System.out.println(count * lost); } }