#include #include using namespace std; int main(){ int a, b, n; vector record; int count = 0; int judge = 0; cin >> a; cin >> b; cin >> n; int c[n]; for(int i = 0; i < n; i++){ cin >> c[i]; } record.push_back(c[0]); for(int i = 0; i < n; i++){ for(int j = 0; j < record.size(); j++){ if(c[i] == record[j]){ count++; break; }else{ judge++; } } if(judge != record.size()){ record.push_back(c[i]); } judge = 0; } cout << (a + b) * count << endl; return 0; }