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