p1, p2, N = map(int, input().split()) s = {int(input()) for _ in range(N)} print((p1 + p2) * (N - len(s)))