P1 = int(input()) P2 = int(input()) N = int(input()) reservation = [] omitted = set() for i in range(N): numb = int(input()) reservation.append(numb) omitted.add(numb) loss = (len(reservation) - len(omitted)) * (P1 + P2) print(loss)