#include #include using namespace std; int main(void) { int p1, p2, n, r; cin >> p1 >> p2 >> n; set st; for (int i = 0; i < n; ++i) { cin >> r; st.insert(r); } int diff = n - st.size(); cout << p1 * diff + p2 * diff << endl; return 0; }