P = int(input()) + int(input()) N = int(input()) L = {int(input()) for _ in range(N)} print(P * (N-len(L)))