import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        int numOfPeople = sc.nextInt();
        Boolean[] isExist = new Boolean[numOfPeople];
        for (int i = 0; i < numOfPeople; i++) {
            isExist[i] = false;
        }
        int numOftype = sc.nextInt();
        int[] nowType = new int[numOftype];
        int[][] A = new int[numOftype][numOfPeople];
        int ans = 0;

        for (int i = 0; i < numOftype; i++) {
            nowType[i] = sc.nextInt();
            for (int j = 0; j < nowType[i]; j++) {
                A[i][j] = sc.nextInt();
            }
        }

        for (int i = 0; i < numOftype; i++) {
            for (int j = 0; j < nowType[i]; j++) {
                for (int k = 0; k < numOfPeople; k++) {
                    if (A[i][j] == k + 1) {
                        isExist[k] = true;
                    }
                }
            }
        }
        for (int i = 0; i < numOfPeople; i++) {
            if (!isExist[i]) {
                ans++;
            }

        }

        System.out.println(ans);
    }
} import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        int numOfPeople = sc.nextInt();
        Boolean[] isExist = new Boolean[numOfPeople];
        for (int i = 0; i < numOfPeople; i++) {
            isExist[i] = false;
        }
        int numOftype = sc.nextInt();
        int[] nowType = new int[numOftype];
        int[][] A = new int[numOftype][numOfPeople];
        int ans = 0;

        for (int i = 0; i < numOftype; i++) {
            nowType[i] = sc.nextInt();
            for (int j = 0; j < nowType[i]; j++) {
                A[i][j] = sc.nextInt();
            }
        }

        for (int i = 0; i < numOftype; i++) {
            for (int j = 0; j < nowType[i]; j++) {
                for (int k = 0; k < numOfPeople; k++) {
                    if (A[i][j] == k + 1) {
                        isExist[k] = true;
                    }
                }
            }
        }
        for (int i = 0; i < numOfPeople; i++) {
            if (!isExist[i]) {
                ans++;
            }

        }

        System.out.println(ans);
    }
} Main public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        int numOfPeople = sc.nextInt();
        Boolean[] isExist = new Boolean[numOfPeople];
        for (int i = 0; i < numOfPeople; i++) {
            isExist[i] = false;
        }
        int numOftype = sc.nextInt();
        int[] nowType = new int[numOftype];
        int[][] A = new int[numOftype][numOfPeople];
        int ans = 0;

        for (int i = 0; i < numOftype; i++) {
            nowType[i] = sc.nextInt();
            for (int j = 0; j < nowType[i]; j++) {
                A[i][j] = sc.nextInt();
            }
        }

        for (int i = 0; i < numOftype; i++) {
            for (int j = 0; j < nowType[i]; j++) {
                for (int k = 0; k < numOfPeople; k++) {
                    if (A[i][j] == k + 1) {
                        isExist[k] = true;
                    }
                }
            }
        }
        for (int i = 0; i < numOfPeople; i++) {
            if (!isExist[i]) {
                ans++;
            }

        }

        System.out.println(ans);
    } main {

        Scanner sc = new Scanner(System.in);

        int numOfPeople = sc.nextInt();
        Boolean[] isExist = new Boolean[numOfPeople];
        for (int i = 0; i < numOfPeople; i++) {
            isExist[i] = false;
        }
        int numOftype = sc.nextInt();
        int[] nowType = new int[numOftype];
        int[][] A = new int[numOftype][numOfPeople];
        int ans = 0;

        for (int i = 0; i < numOftype; i++) {
            nowType[i] = sc.nextInt();
            for (int j = 0; j < nowType[i]; j++) {
                A[i][j] = sc.nextInt();
            }
        }

        for (int i = 0; i < numOftype; i++) {
            for (int j = 0; j < nowType[i]; j++) {
                for (int k = 0; k < numOfPeople; k++) {
                    if (A[i][j] == k + 1) {
                        isExist[k] = true;
                    }
                }
            }
        }
        for (int i = 0; i < numOfPeople; i++) {
            if (!isExist[i]) {
                ans++;
            }

        }

        System.out.println(ans);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int numOfPeople = sc.nextInt(); numOfPeople sc.nextInt() sc.nextInt sc Boolean[] isExist = new Boolean[numOfPeople]; isExist new Boolean[numOfPeople] numOfPeople for (int i = 0; i < numOfPeople; i++) {
            isExist[i] = false;
        } int i = 0; int i = 0; i 0 i < numOfPeople i numOfPeople i++ i++ i {
            isExist[i] = false;
        } {
            isExist[i] = false;
        } isExist[i] = false isExist[i] isExist i false int numOftype = sc.nextInt(); numOftype sc.nextInt() sc.nextInt sc int[] nowType = new int[numOftype]; nowType new int[numOftype] numOftype int[][] A = new int[numOftype][numOfPeople]; A new int[numOftype][numOfPeople] numOftype numOfPeople int ans = 0; ans 0 for (int i = 0; i < numOftype; i++) {
            nowType[i] = sc.nextInt();
            for (int j = 0; j < nowType[i]; j++) {
                A[i][j] = sc.nextInt();
            }
        } int i = 0; int i = 0; i 0 i < numOftype i numOftype i++ i++ i {
            nowType[i] = sc.nextInt();
            for (int j = 0; j < nowType[i]; j++) {
                A[i][j] = sc.nextInt();
            }
        } {
            nowType[i] = sc.nextInt();
            for (int j = 0; j < nowType[i]; j++) {
                A[i][j] = sc.nextInt();
            }
        } nowType[i] = sc.nextInt() nowType[i] nowType i sc.nextInt() sc.nextInt sc for (int j = 0; j < nowType[i]; j++) {
                A[i][j] = sc.nextInt();
            } int j = 0; int j = 0; j 0 j < nowType[i] j nowType[i] nowType i j++ j++ j {
                A[i][j] = sc.nextInt();
            } {
                A[i][j] = sc.nextInt();
            } A[i][j] = sc.nextInt() A[i][j] A[i] A i j sc.nextInt() sc.nextInt sc for (int i = 0; i < numOftype; i++) {
            for (int j = 0; j < nowType[i]; j++) {
                for (int k = 0; k < numOfPeople; k++) {
                    if (A[i][j] == k + 1) {
                        isExist[k] = true;
                    }
                }
            }
        } int i = 0; int i = 0; i 0 i < numOftype i numOftype i++ i++ i {
            for (int j = 0; j < nowType[i]; j++) {
                for (int k = 0; k < numOfPeople; k++) {
                    if (A[i][j] == k + 1) {
                        isExist[k] = true;
                    }
                }
            }
        } {
            for (int j = 0; j < nowType[i]; j++) {
                for (int k = 0; k < numOfPeople; k++) {
                    if (A[i][j] == k + 1) {
                        isExist[k] = true;
                    }
                }
            }
        } for (int j = 0; j < nowType[i]; j++) {
                for (int k = 0; k < numOfPeople; k++) {
                    if (A[i][j] == k + 1) {
                        isExist[k] = true;
                    }
                }
            } int j = 0; int j = 0; j 0 j < nowType[i] j nowType[i] nowType i j++ j++ j {
                for (int k = 0; k < numOfPeople; k++) {
                    if (A[i][j] == k + 1) {
                        isExist[k] = true;
                    }
                }
            } {
                for (int k = 0; k < numOfPeople; k++) {
                    if (A[i][j] == k + 1) {
                        isExist[k] = true;
                    }
                }
            } for (int k = 0; k < numOfPeople; k++) {
                    if (A[i][j] == k + 1) {
                        isExist[k] = true;
                    }
                } int k = 0; int k = 0; k 0 k < numOfPeople k numOfPeople k++ k++ k {
                    if (A[i][j] == k + 1) {
                        isExist[k] = true;
                    }
                } {
                    if (A[i][j] == k + 1) {
                        isExist[k] = true;
                    }
                } if (A[i][j] == k + 1) {
                        isExist[k] = true;
                    } A[i][j] == k + 1 A[i][j] A[i] A i j k + 1 k 1 {
                        isExist[k] = true;
                    } isExist[k] = true isExist[k] isExist k true for (int i = 0; i < numOfPeople; i++) {
            if (!isExist[i]) {
                ans++;
            }

        } int i = 0; int i = 0; i 0 i < numOfPeople i numOfPeople i++ i++ i {
            if (!isExist[i]) {
                ans++;
            }

        } {
            if (!isExist[i]) {
                ans++;
            }

        } if (!isExist[i]) {
                ans++;
            } !isExist[i] isExist[i] isExist i {
                ans++;
            } ans++ ans System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        int numOfPeople = sc.nextInt();
        Boolean[] isExist = new Boolean[numOfPeople];
        for (int i = 0; i < numOfPeople; i++) {
            isExist[i] = false;
        }
        int numOftype = sc.nextInt();
        int[] nowType = new int[numOftype];
        int[][] A = new int[numOftype][numOfPeople];
        int ans = 0;

        for (int i = 0; i < numOftype; i++) {
            nowType[i] = sc.nextInt();
            for (int j = 0; j < nowType[i]; j++) {
                A[i][j] = sc.nextInt();
            }
        }

        for (int i = 0; i < numOftype; i++) {
            for (int j = 0; j < nowType[i]; j++) {
                for (int k = 0; k < numOfPeople; k++) {
                    if (A[i][j] == k + 1) {
                        isExist[k] = true;
                    }
                }
            }
        }
        for (int i = 0; i < numOfPeople; i++) {
            if (!isExist[i]) {
                ans++;
            }

        }

        System.out.println(ans);
    }
} public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        int numOfPeople = sc.nextInt();
        Boolean[] isExist = new Boolean[numOfPeople];
        for (int i = 0; i < numOfPeople; i++) {
            isExist[i] = false;
        }
        int numOftype = sc.nextInt();
        int[] nowType = new int[numOftype];
        int[][] A = new int[numOftype][numOfPeople];
        int ans = 0;

        for (int i = 0; i < numOftype; i++) {
            nowType[i] = sc.nextInt();
            for (int j = 0; j < nowType[i]; j++) {
                A[i][j] = sc.nextInt();
            }
        }

        for (int i = 0; i < numOftype; i++) {
            for (int j = 0; j < nowType[i]; j++) {
                for (int k = 0; k < numOfPeople; k++) {
                    if (A[i][j] == k + 1) {
                        isExist[k] = true;
                    }
                }
            }
        }
        for (int i = 0; i < numOfPeople; i++) {
            if (!isExist[i]) {
                ans++;
            }

        }

        System.out.println(ans);
    }
} Main
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        int numOfPeople = sc.nextInt();
        Boolean[] isExist = new Boolean[numOfPeople];
        for (int i = 0; i < numOfPeople; i++) {
            isExist[i] = false;
        }
        int numOftype = sc.nextInt();
        int[] nowType = new int[numOftype];
        int[][] A = new int[numOftype][numOfPeople];
        int ans = 0;

        for (int i = 0; i < numOftype; i++) {
            nowType[i] = sc.nextInt();
            for (int j = 0; j < nowType[i]; j++) {
                A[i][j] = sc.nextInt();
            }
        }

        for (int i = 0; i < numOftype; i++) {
            for (int j = 0; j < nowType[i]; j++) {
                for (int k = 0; k < numOfPeople; k++) {
                    if (A[i][j] == k + 1) {
                        isExist[k] = true;
                    }
                }
            }
        }
        for (int i = 0; i < numOfPeople; i++) {
            if (!isExist[i]) {
                ans++;
            }

        }

        System.out.println(ans);
    }
}
