p1, p2, N = [int(input()) for _ in range(3)] s = {int(input()) for _ in range(N)} print((p1 + p2) * (N - len(s)))