#include using namespace std; int room[1000] = {0}; int bookking = 0; int yuki, other; int main(){ cin >> yuki >> other; int n; cin >> n; int res; for(int i = 0; i < n; i++){ cin >> res; if(room[res] == 1) bookking += 1; room[res] = 1; } cout << bookking * (yuki + other) << endl; return 0; }