import java.util.*
import kotlin.collections.HashMap

fun main(args: Array<String>) {
    val read = Scanner(System.`in`)
    var n = read.nextInt()
    var k = read.nextInt()
    val map = HashMap<Int , MutableList<Int>>()
    for(i in 1..n)
        map.put(i , ArrayList())
    for(row in 1..k) {
        val d = read.nextInt()
        for(col in 1..d) {
            val snuck = read.nextInt()
            map.get(snuck)?.add(col)
        }
    }
    var count = 0;
    for((x , y) in map)
        if(y.isEmpty()) count++
    println(count)

}