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