P = int(input()) + int(input()) N = int(input()) line = [int(input()) for i in range(N)] print(((len(line)) - len(set(line))) * P )