fun main(args: Array<String>) {
    val line = readLine()!!.trim()
    val (n, k) = line.split(" ").map {it.toInt()}

    val sunukes: MutableList<MutableList<Int>> = (0..n-1).map { mutableListOf<Int>() }.toMutableList()

    for (i in (0..k-1)) {
        val d = readLine()!!.trim().toInt()
        val ary = readLine()!!.trim().split(" ").map {it.toInt()}.take(d)
        ary.forEach {sunukes[it - 1].add(i + 1)}
    }

    println("${sunukes.filter {it.isEmpty()}.size}")
}