i = input P1 = int(i()) P2 = int(i()) N = int(i()) R = [int(i()) for _ in range(N)] print((len(R) - len(set(R))) * (P1 + P2))