package main import ( "bufio" "fmt" "os" "strconv" ) var sc = bufio.NewScanner(os.Stdin) func nextInt() int { sc.Scan() i, err := strconv.Atoi(sc.Text()) if err != nil { panic(err) } return i } func main() { sc.Split(bufio.ScanWords) p1 := nextInt() p2 := nextInt() n := nextInt() rs := make(map[int]struct{}) for i := 0; i < n; i++ { rs[nextInt()] = struct{}{} } fmt.Println((n - len(rs)) * (p1 + p2)) }