import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int minus = sc.nextInt() + sc.nextInt(); int n = sc.nextInt(); HashSet reserve = new HashSet<>(); int count = 0; for (int i = 0; i < n; i++) { int x = sc.nextInt(); if (reserve.contains(x)) { count++; } else { reserve.add(x); } } System.out.println(count * minus); } }