import java.util.Arrays; import java.util.HashSet; import java.util.LinkedList; import java.util.Scanner; public class Main { public static long MOD = 1000000007; public static void main(String[] args) { Scanner sc = new Scanner(System.in); final long P1 = sc.nextLong(); final long P2 = sc.nextLong(); long answer = 0; final int N = sc.nextInt(); HashSet already = new HashSet(); for(int i = 0; i < N; i++){ final int R = sc.nextInt(); if(already.contains(R)){ answer += P1 + P2; }else{ already.add(R); } } System.out.println(answer); } }