
import java.io.*;
import java.util.*;
import java.lang.*;

public class Main {
	public static void main (String[] args) {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int k=sc.nextInt();
		int[] arr=new int[n+1];
		int temp=k;
		int d=0,val=0,count=0;
		while(k!=0)
		{
		 d=sc.nextInt();
		 for(int i=0;i<d;i++)
		 {
		     val=sc.nextInt();
		     arr[val]++;
		 }
		 k--;
		}
		 for(int i=0;i<=n;i++)
		 {
		     if(arr[i]==0)
		     count++;
		 }
		 count--;
		 System.out.println(count);
		
	}
} import java.io.*; io.* java import java.util.*; util.* java import java.lang.*; lang.* java public class Main {
	public static void main (String[] args) {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int k=sc.nextInt();
		int[] arr=new int[n+1];
		int temp=k;
		int d=0,val=0,count=0;
		while(k!=0)
		{
		 d=sc.nextInt();
		 for(int i=0;i<d;i++)
		 {
		     val=sc.nextInt();
		     arr[val]++;
		 }
		 k--;
		}
		 for(int i=0;i<=n;i++)
		 {
		     if(arr[i]==0)
		     count++;
		 }
		 count--;
		 System.out.println(count);
		
	}
} Main public static void main (String[] args) {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int k=sc.nextInt();
		int[] arr=new int[n+1];
		int temp=k;
		int d=0,val=0,count=0;
		while(k!=0)
		{
		 d=sc.nextInt();
		 for(int i=0;i<d;i++)
		 {
		     val=sc.nextInt();
		     arr[val]++;
		 }
		 k--;
		}
		 for(int i=0;i<=n;i++)
		 {
		     if(arr[i]==0)
		     count++;
		 }
		 count--;
		 System.out.println(count);
		
	} main {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int k=sc.nextInt();
		int[] arr=new int[n+1];
		int temp=k;
		int d=0,val=0,count=0;
		while(k!=0)
		{
		 d=sc.nextInt();
		 for(int i=0;i<d;i++)
		 {
		     val=sc.nextInt();
		     arr[val]++;
		 }
		 k--;
		}
		 for(int i=0;i<=n;i++)
		 {
		     if(arr[i]==0)
		     count++;
		 }
		 count--;
		 System.out.println(count);
		
	} Scanner sc=new Scanner(System.in); sc new Scanner(System.in) int n=sc.nextInt(); n sc.nextInt() sc.nextInt sc int k=sc.nextInt(); k sc.nextInt() sc.nextInt sc int[] arr=new int[n+1]; arr new int[n+1] n+1 n 1 int temp=k; temp k int d=0 d 0 val=0 val 0 count=0; count 0 while(k!=0)
		{
		 d=sc.nextInt();
		 for(int i=0;i<d;i++)
		 {
		     val=sc.nextInt();
		     arr[val]++;
		 }
		 k--;
		} k!=0 k 0 {
		 d=sc.nextInt();
		 for(int i=0;i<d;i++)
		 {
		     val=sc.nextInt();
		     arr[val]++;
		 }
		 k--;
		} d=sc.nextInt() d sc.nextInt() sc.nextInt sc for(int i=0;i<d;i++)
		 {
		     val=sc.nextInt();
		     arr[val]++;
		 } int i=0; int i=0; i 0 i<d i d i++ i++ i {
		     val=sc.nextInt();
		     arr[val]++;
		 } {
		     val=sc.nextInt();
		     arr[val]++;
		 } val=sc.nextInt() val sc.nextInt() sc.nextInt sc arr[val]++ arr[val] arr val k-- k for(int i=0;i<=n;i++)
		 {
		     if(arr[i]==0)
		     count++;
		 } int i=0; int i=0; i 0 i<=n i n i++ i++ i {
		     if(arr[i]==0)
		     count++;
		 } {
		     if(arr[i]==0)
		     count++;
		 } if(arr[i]==0)
		     count++; arr[i]==0 arr[i] arr i 0 count++ count count-- count System.out.println(count) System.out.println System.out System System.out count String[] args args public class Main {
	public static void main (String[] args) {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int k=sc.nextInt();
		int[] arr=new int[n+1];
		int temp=k;
		int d=0,val=0,count=0;
		while(k!=0)
		{
		 d=sc.nextInt();
		 for(int i=0;i<d;i++)
		 {
		     val=sc.nextInt();
		     arr[val]++;
		 }
		 k--;
		}
		 for(int i=0;i<=n;i++)
		 {
		     if(arr[i]==0)
		     count++;
		 }
		 count--;
		 System.out.println(count);
		
	}
} public class Main {
	public static void main (String[] args) {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int k=sc.nextInt();
		int[] arr=new int[n+1];
		int temp=k;
		int d=0,val=0,count=0;
		while(k!=0)
		{
		 d=sc.nextInt();
		 for(int i=0;i<d;i++)
		 {
		     val=sc.nextInt();
		     arr[val]++;
		 }
		 k--;
		}
		 for(int i=0;i<=n;i++)
		 {
		     if(arr[i]==0)
		     count++;
		 }
		 count--;
		 System.out.println(count);
		
	}
} Main

import java.io.*;
import java.util.*;
import java.lang.*;

public class Main {
	public static void main (String[] args) {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int k=sc.nextInt();
		int[] arr=new int[n+1];
		int temp=k;
		int d=0,val=0,count=0;
		while(k!=0)
		{
		 d=sc.nextInt();
		 for(int i=0;i<d;i++)
		 {
		     val=sc.nextInt();
		     arr[val]++;
		 }
		 k--;
		}
		 for(int i=0;i<=n;i++)
		 {
		     if(arr[i]==0)
		     count++;
		 }
		 count--;
		 System.out.println(count);
		
	}
}