P = int(input()) + int(input()) N = int(input()) R = set([int(input()) for _ in range(N)]) r = N - len(R) print(P * r)