#include #include using namespace std; int main(){ int P1, P2, N; cin >> P1 >> P2 >> N; vector bookings; for(int i = 0; i < N; i++){ int booking; cin >> booking; bool if_ok = true; for(int j = 0; j < bookings.size(); j++){ if(bookings[j] == booking){ if_ok = false; break; } } if(if_ok){ bookings.push_back(booking); } } cout << (N - bookings.size()) * (P1 + P2) << endl; }