p1 = int(input()) p2 = int(input()) n = int(input()) x = [int(input()) for i in range(n)] ans = (n-len(set(x)))*(p1+p2) print(ans)