package algo; import java.util.*; public class sample7 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int P1 = sc.nextInt(); int P2 = sc.nextInt(); int N = sc.nextInt(); List list = new ArrayList(); for(int i=0; i < N; i++) { list.add(sc.nextInt()); } Set set = new HashSet(list); int AN = list.size() - set.size(); int c = AN * P1 + AN * P2; System.out.println(c); } }