#include using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); int P1, P2, N; cin >> P1 >> P2 >> N; unordered_set s; for (int i = 0; i < N; ++i) { int t; cin >> t; s.insert(t); } cout << (P1+P2) * (N-s.size()) << endl; return 0; }