unittest
{
	assert( [ "3 2", "2", "1 3", "1", "3" ].parse.expand.solve == 1 );
	assert( [ "3 3", "1", "3", "1", "3", "1", "3" ].parse.expand.solve == 2 );
}



import std.conv;
import std.range;
import std.stdio;
import std.typecons;

void main()
{
	stdin.byLineCopy.parse.expand.solve.writeln;
}

auto parse( Range )( Range input )
if( isInputRange!Range && is( ElementType!Range == string ) )
{
	auto nk = input.front.split.to!( long[] );
	auto ass = new long[][ nk[ 1 ] ];
	foreach( ref as; ass )
	{
		input.popFront;
		input.popFront;
		as = input.front.split.to!( long[] );
		as[] -= 1;
	}
	return tuple( nk[ 0 ], ass );
}

auto solve( long n, long[][] ass )
{
	auto cs = new long[ n ];
	foreach( as; ass )
	{
		foreach( a; as )
		{
			cs[ a ]++;
		}
	}
	
	auto ans = 0L;
	foreach( c; cs )
	{
		ans += ( c == 0 );
	}
	return ans;
}
