import java.util.ArrayList; import java.util.HashSet; import java.util.Scanner; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); int p1 = sc.nextInt(); int p2 = sc.nextInt(); int n = sc.nextInt(); ArrayList li = new ArrayList(); for(int i = 0 ; i < n ; i++) { int r = sc.nextInt(); li.add(r); } HashSet hs = new HashSet(li); int a = n - hs.size(); System.out.println(a * p1 + a * p2); } }