P1, P2, N = [int(input().strip()) for i in range(3)] R = [0 for _ in range(1000)] for i in range(N): R[int(input())] += 1 print((P1 + P2) * (sum(R) - len([i for i in R if i > 0])))