#include using namespace std; using ll = long long; using vll = vector; int main() { ll p1, p2, n; cin >> p1 >> p2 >> n; unordered_map mp; for (ll i = 0; i < n; i++) { ll r; cin >> r; if (mp.find(r) != mp.end()) { mp[r]++; } else { mp[r] = 0; } } ll s = 0; for (const auto &i : mp) { s += i.second; } ll ans = (p1 + p2) * s; cout<