import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int P1 = scan.nextInt(); int P2 = scan.nextInt(); int N = scan.nextInt(); int []R = new int[N]; for(int i = 0; i < N; i++) { R[i] = scan.nextInt(); } scan.close(); Arrays.sort(R); int temp = R[0]; int cnt = 0; for(int i = 1; i < N; i++) { if(temp == R[i]) { cnt ++; }else { temp = R[i]; } } int ans = (P1 + P2) * cnt; System.out.println(ans); } }