#include <math.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

typedef unsigned long long int ull;
typedef long long int ll;
typedef long double ld;

int compare_base(const void *b, const void *f) {
  return (*(int *)b - *(int *)f);
}

int main(void) {
  int scan; // scanf result
  int *answer; // to output 
  int n; // to input 
  int k; // to input 
  int *d;
  int **ad;
  int count;

  scan = scanf("%d", &n);
  scan = scanf("%d", &k);

  d = (int *)malloc(sizeof(int) * k);
  ad = (int **)malloc(sizeof(int *) * k);
  for (int i = 0; i < k; i++) {
    scan = scanf("%d", &d[i]);
    ad[i] = (int *)malloc(sizeof(int) * d[i]);
    for (int m = 0; m < d[i]; m++) {
      scan = scanf("%d", &ad[i][m]);
    }
  }

  int dsum = 0;
  for (int i = 0; i < k; i++) {
      dsum += d[i];
  }

  answer = (int *)malloc(sizeof(int) * k * dsum);
  count = 0; 
  for (int y = 0; y < k; y++) {
    for (int x = 0; x < d[y]; x++) {
      answer[count] = ad[y][x];
      count++;
    }
  }
  
  qsort(answer, k * dsum, sizeof(int), compare_base);

  int answercount = 0;
  for (int i = 0; i < k * dsum; i++) {
    if (i == 0 || (i >= 1 && answer[i - 1] != answer[i])) {
      answercount++;
    }
  }

  printf("%d", (n - answercount + 1));
  return (0);
}
