#include #define rep(i, n) for (int i = 0; i < n; ++i) using ll = long long; using namespace std; const int INF = 1e9; int main() { int A, B, N; cin >> A >> B >> N; int cnt = 0; map mp; rep(i, N) { int r; cin >> r; mp[r]++; if(mp[r]>=2) cnt++; } cout << (A + B) * cnt << endl; return 0; }