p1 = int(input()) p2 = int(input()) N = int(input()) R = set([int(input())for i in range(N)]) loss = N - len(R) print(loss*(p1 + p2))