#include<stdio.h>

void sort(int *c,int N){
    int i,temp;
    for(i=0;i<N-1;i++){
        if(c[i]>c[i+1]){
            temp = c[i];
            c[i] = c[i+1];
            c[i+1] = temp;
        }
    }
}

int main(void){
    int N,K;
    int i,j;
    
    scanf("%d %d",&N,&K);

    int d[K],A[K][N],c[K*N],n=0,sum=1;

    for(i=0;i<K;i++){
        scanf("%d",&d[i]);
        for(j=0;j<d[i];j++){
            scanf("%d",&A[i][j]);
        }
    }

    for(i=0;i<K;i++){
        for(j=0;j<d[i];j++){
            c[n] = A[i][j];
            if(i==K-1 && j==d[K-1]-1) break;
            n++;
        }
    }

    sort(c,n);

    for(i=0;i<n-1;i++){
        if(c[i]!=c[i+1]) sum += 1;
    }

    printf("%d",N-sum);

    return 0;
}