#include<stdio.h>
int main()
{
	unsigned long a,b;
	scanf("%lu %lu",&a,&b);
  unsigned long c[b],i,j,flag[100000],l,k,sum=0;
  flag[0]=0;
  unsigned long A[b][100];
  for(i=1;i<b;i++){
    scanf("%lu",&c[i]);
    for(j=0;j<c[i];j++){
      scanf("%lu",&A[i][j]);
      k=0;
    for(l=0;l<sum+1;l++){
      if(flag[l]==A[i][j]){
        k=1;
        break;
      }
    }
      if(k==0){
        sum++;
        flag[sum]=A[i][j];
      }
    }
  }
  
  
  
  
  printf("%lu",a-sum);
	return 0;
}
