import strutils, sequtils let N = stdin.readLine.parseInt var a = stdin.readLine.split.map parseInt cnt = 0 while a.len != 0: let i = find(a, a.min) if i != 0: cnt += 1 a.delete i echo cnt