#include using namespace std; signed main(){ int p1,p2,n;cin>>p1>>p2>>n; map m; while(n--){ int a;cin>>a;m[a]++; } int ans=0; for(auto p:m)ans+=p.second-1; ans*=p1+p2; cout<