import java.util.*; 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(); HashMap map = new HashMap(); for(int i = 0; i < n; i++) { int r = sc.nextInt(); if(map.containsKey(r)) { map.put(r, map.get(r) + 1); } else { map.put(r, 1); } } int ans = 0; for(int r : map.keySet()) { ans += (map.get(r) - 1); } ans = (ans * (p1 + p2)); System.out.println(ans); } }