A=lambda:int(input()) P=A()+A() N=A() S=set() for i in range(N):S.add(A()) print(P*(N-len(S)))