#include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; int main(){ ll a,b; ll n; cin >> a >> b >> n; map mp; for(int i = 0;i < n;i++){ ll in; cin >> in; mp[in]++; } ll res = 0; for(auto i:mp){ res += i.second - 1; } res *= a + b; cout << res << endl; }