P1, P2, N, *R = map(int, open(0)) M = len(set(R)) print((P1 + P2) * (N - M))