import java.io.BufferedInputStream fun main(args: Array){ fun iterateTokens(): Iterator { val reader = BufferedInputStream(System.`in`).bufferedReader() val iterator = reader.lineSequence() .map { it.split(" ") } .reduce { left, right -> left + right } .iterator() return iterator } val tokens = iterateTokens() val n = tokens.next().toInt() val aList = LongArray(n) for (i in 0 until n){ aList[i] = tokens.next().toLong() } val map = mutableMapOf().withDefault{ 0 } for (a in aList){ map[a] = (map[a]?:0) + 1 } println(map.filter{ it.value == 1}.size) }