P1 = int(input()) P2 = int(input()) N = int(input()) Rs = {int(input()) for x in range(N)} C = (N - len(Rs)) * (P1 + P2) print(C)