fun main() {
    val input = readLine()!!.split(' ').map { it.toInt() }
    val map = mutableMapOf<Int, Int>()

    repeat(input[1]) {
        readLine()
        readLine()!!.split(' ').map { it.toInt() }.forEach {
            map[it] = (map[it] ?: 0) + 1
        }
    }

    println(input[0] - map.size)
}