a = int(input()) b = int(input()) n = int(input()) r = len(set([int(input()) for _ in range(n)])) print((a + b) * (n - r))