

void main(){
	
	auto NK = readLine!long();
	
	long[] list = new long[](cast(size_t)NK[0]);
	long K = NK[1];
	
	foreach( i ; 0..K ){
		auto type = readLine!int()[0];
		auto toList = readLine!int();
		foreach( to ; toList ){
			list[to-1] += type;
		}
	}
	
	list.count(0).writeln();
}



import std;

string alphabet = "abcdefghijklmnopqrstuvwxyz";

string readStr(){
	return readln().chomp();
}
T[] readLine( T = long )(){
	return readln().split().to!(T[])();
}