from sys import stdin def readLine_int_list():return list(map(int, stdin.readline().split())) def readAll_int(): return list(map(int, stdin)) def main(): memo = {} p1 = int(input()) p2 = int(input()) n = int(input()) r = readAll_int() c = 0 for i in r: if i in memo: c += 1 memo[i] = 1 print(c*(p1+p2)) if __name__ == "__main__": main()