#include int main (void){ int a,b,c,n; int r[100],e[999]={0}; scanf("%d%d%d",&a,&b,&n); for(int i = 0;i < n;i++) scanf("%d",&r[i]); for(int i = 0;i < n;i++){ if(e[r[i]] == 0)e[r[i]] = 1; else c++; } printf("%d",(a+b)*c); return(0); }