Module AtCoder166
  
    Sub Main(args As String())

        Dim arr As String() = Split(Console.ReadLine())
        Dim Sunuke_Count As Integer = CInt(arr(0))
        Dim Kashi_Count As Integer = CInt(arr(1))

        'スヌケ番号のリスト
        Dim suneke_List As List(Of Integer) = New List(Of Integer)()
        For i As Integer = 1 To Sunuke_Count
            suneke_List.Add(i)
        Next

        For i As Integer = 1 To Kashi_Count
            Dim hold_Sunuke_count As Integer = CInt(Console.ReadLine())
            Dim hold_Sunuke_num As String() = Split(Console.ReadLine())
            For j As Integer = 1 To hold_Sunuke_count
                Dim targetSunukeNum As Integer = CInt(hold_Sunuke_num(j - 1))
                If suneke_List.Contains(targetSunukeNum) = True Then suneke_List.Remove(targetSunukeNum)
                If suneke_List.Count = 0 Then Exit For
            Next
            If suneke_List.Count = 0 Then Exit For
        Next

        Console.WriteLine(suneke_List.Count.ToString())

    End Sub

End Module