import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a = sc.nextInt(); int b = sc.nextInt(); int n = sc.nextInt(); int[] r = new int[n]; for(int i = 0 ; i < n ; i++) r[i] = sc.nextInt(); int sum = 0; for(int i = 0 ; i < n ; i++) { for(int j = i + 1 ; j < n ; j++) { if(r[i] == r[j]) { sum += a + b; break; } } } System.out.println(sum); } }