#include using namespace std; int main() { int a, b, N; int R[1000]; int n; int sum; int count = 0; cin >> a >> b >> N; for (int i = 0; i < N; i++) { cin >> n; if (R[n] == 0) { count++; } else { R[n] = 0; } } sum = (a + b)*count; cout << sum; return 0; }