#include <stdio.h>
#include <stdlib.h>

int asc(const void *a, const void *b) {
  return *(int *)a - *(int *)b;
}

int main() {
  short sunuke_count;
  short sweets_kind_count;
  scanf("%hd %hd", &sunuke_count, &sweets_kind_count);

  short has_sweets_count[sweets_kind_count];
  short sweets_kind = 0;

  short sunuke_array[sunuke_count];

  short i = 0;
  while (sweets_kind < sweets_kind_count) {
    scanf("%hd", has_sweets_count + sweets_kind);
    for (short j = 0; j < has_sweets_count[sweets_kind]; j += 1) {
      scanf("%hd", sunuke_array + i);
      i += 1;
    }
    sweets_kind += 1;
  }
  qsort(sunuke_array, i, sizeof(short), asc);

  short sunuke_genuine_count = 0;
  for (short k = 0; k < i; k += 1) {
    if (sunuke_array[k] != sunuke_array[k + 1]) {
      sunuke_genuine_count += 1;
    }
  }
  short output = sunuke_count - sunuke_genuine_count;
  printf("%hd", output);
  printf("%c", '\n');
  return 0;
}
