
Module Module1

    Sub main()
        Dim user2 As List(Of String) = New List(Of String)(Split(Console.ReadLine(), " "))
        Dim sunukeNum As Long = user2(0)
        Dim okashiType As Long = user2(1)
        Dim sunukeHaveOkashi(sunukeNum - 1) As Boolean

        ' お菓子の種類分だけループ
        For i = 0 To okashiType - 1
            Dim user1 = Console.ReadLine()
            Dim user3 As List(Of String) = New List(Of String)(Split(Console.ReadLine(), " "))

            'Dim okashies As New List(Of Long)
            'okashies = New List(Of Long)(Array.ConvertAll(user3, Function(j As String) CLng(j)))
            Dim okashies As New List(Of Long)(Array.ConvertAll(user3.ToArray, Function(j As String) CLng(j)))

            For Each myOkashi In okashies
                sunukeHaveOkashi(myOkashi - 1) = True

                'Console.WriteLine(myOkashi - 1 & "にお菓子をもたせました")
            Next
        Next

        Dim sss As New List(Of Boolean)(sunukeHaveOkashi)
        Console.WriteLine(sss.FindAll(Function(n) Not n).Count)
    End Sub
end module