import strutils, sequtils, algorithm var cnt = 0 N, A = stdin.readLine.split.map parseInt A.sort(cmp) A.insert(0) A.add(0) for i in countdown(A.high - 1, 1): let Ai = A[i] if Ai != A[i - 1] and Ai != A[i + 1]: cnt += 1 A.delete(A.high) echo cnt