yp = int(input()) op = int(input()) n = int(input()) l = [int(input()) for _ in range(n)] d = len(l) - len(set(l)) print(d*(yp+op))