P1 = int(input()) P2 = int(input()) N = int(input()) R = [] OPPORTUNITY = 0 TRANSFER = 0 for i in range(N) : r = int(input()) if r not in R : R.append(r) else : OPPORTUNITY += P1 TRANSFER += P2 print(OPPORTUNITY + TRANSFER)