import intsets, sequtils, strutils let p1, p2, n = parseInt readLine stdin p = p1 + p2 rs = n.newSeqWith parseInt readLine stdin card = rs.toIntSet.card echo p * n.pred card