import std;
enum inf(T)()if(__traits(isArithmetic,T)){return T.max/4;}
T scan(T=long)(){return readln.chomp.to!T;}
void scan(T...)(ref T args){auto input=readln.chomp.split;foreach(i,t;T)args[i]=input[i].to!t;}T[] scanarr(T=long)(){return readln.chomp.split.to!(T[]);}
//END OF TEMPLATE

void main(){
    ulong n,k;
    scan(n,k);
    ulong[ulong] a;
    foreach(i;0..k){ 
        scan!int;
        scanarr!ulong.each!(as=>a[as]=0);
    }       
    iota(1,n+1).filter!(s=>!(s in a)).array.length.writeln;
}
