n,b,x[];main(a){scanf("%d%d%*d",&a,&b);for(a+=b;scanf("%d",&b)+1;x[b]++)if(x[b])n++;printf("%d",a*n);}