G, Z = [gets,gets].map(&:to_i) A = gets.to_i V = Array(A) {|_| gets }.uniq puts (A - V.size) * (G + Z)