import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt(); // すぬけ君の数
        int K = sc.nextInt(); // お菓子の種類
        int[] d = new int[K]; // 何人お菓子をもっているか
        int[][] A = new int[K][N]; // 誰がお菓子をもっているか
        int[] sunuke = new int[N];

        for (int i = 0; i < K; i++) {
            d[i] = sc.nextInt();
            for (int j = 0; j < d[i]; j++) {
                A[i][sc.nextInt() - 1]++;
            }
        }
        for (int i = 0; i < K; i++) {
            for (int j = 0; j < N; j++) {
                if (A[i][j] != 0) {
                    sunuke[j]++;
                }
            }
        }
        int ans = 0;

        for (int i = 0; i < N; i++) {
            if (sunuke[i] == 0) {
                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 N = sc.nextInt(); // すぬけ君の数
        int K = sc.nextInt(); // お菓子の種類
        int[] d = new int[K]; // 何人お菓子をもっているか
        int[][] A = new int[K][N]; // 誰がお菓子をもっているか
        int[] sunuke = new int[N];

        for (int i = 0; i < K; i++) {
            d[i] = sc.nextInt();
            for (int j = 0; j < d[i]; j++) {
                A[i][sc.nextInt() - 1]++;
            }
        }
        for (int i = 0; i < K; i++) {
            for (int j = 0; j < N; j++) {
                if (A[i][j] != 0) {
                    sunuke[j]++;
                }
            }
        }
        int ans = 0;

        for (int i = 0; i < N; i++) {
            if (sunuke[i] == 0) {
                ans++;
            }
        }
        System.out.println(ans);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt(); // すぬけ君の数
        int K = sc.nextInt(); // お菓子の種類
        int[] d = new int[K]; // 何人お菓子をもっているか
        int[][] A = new int[K][N]; // 誰がお菓子をもっているか
        int[] sunuke = new int[N];

        for (int i = 0; i < K; i++) {
            d[i] = sc.nextInt();
            for (int j = 0; j < d[i]; j++) {
                A[i][sc.nextInt() - 1]++;
            }
        }
        for (int i = 0; i < K; i++) {
            for (int j = 0; j < N; j++) {
                if (A[i][j] != 0) {
                    sunuke[j]++;
                }
            }
        }
        int ans = 0;

        for (int i = 0; i < N; i++) {
            if (sunuke[i] == 0) {
                ans++;
            }
        }
        System.out.println(ans);
    } main {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt(); // すぬけ君の数
        int K = sc.nextInt(); // お菓子の種類
        int[] d = new int[K]; // 何人お菓子をもっているか
        int[][] A = new int[K][N]; // 誰がお菓子をもっているか
        int[] sunuke = new int[N];

        for (int i = 0; i < K; i++) {
            d[i] = sc.nextInt();
            for (int j = 0; j < d[i]; j++) {
                A[i][sc.nextInt() - 1]++;
            }
        }
        for (int i = 0; i < K; i++) {
            for (int j = 0; j < N; j++) {
                if (A[i][j] != 0) {
                    sunuke[j]++;
                }
            }
        }
        int ans = 0;

        for (int i = 0; i < N; i++) {
            if (sunuke[i] == 0) {
                ans++;
            }
        }
        System.out.println(ans);
    } 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[] d = new int[K]; d new int[K] K int[][] A = new int[K][N]; A new int[K][N] K N int[] sunuke = new int[N]; sunuke new int[N] N for (int i = 0; i < K; i++) {
            d[i] = sc.nextInt();
            for (int j = 0; j < d[i]; j++) {
                A[i][sc.nextInt() - 1]++;
            }
        } int i = 0; int i = 0; i 0 i < K i K i++ i++ i {
            d[i] = sc.nextInt();
            for (int j = 0; j < d[i]; j++) {
                A[i][sc.nextInt() - 1]++;
            }
        } {
            d[i] = sc.nextInt();
            for (int j = 0; j < d[i]; j++) {
                A[i][sc.nextInt() - 1]++;
            }
        } d[i] = sc.nextInt() d[i] d i sc.nextInt() sc.nextInt sc for (int j = 0; j < d[i]; j++) {
                A[i][sc.nextInt() - 1]++;
            } int j = 0; int j = 0; j 0 j < d[i] j d[i] d i j++ j++ j {
                A[i][sc.nextInt() - 1]++;
            } {
                A[i][sc.nextInt() - 1]++;
            } A[i][sc.nextInt() - 1]++ A[i][sc.nextInt() - 1] A[i] A i sc.nextInt() - 1 sc.nextInt() sc.nextInt sc 1 for (int i = 0; i < K; i++) {
            for (int j = 0; j < N; j++) {
                if (A[i][j] != 0) {
                    sunuke[j]++;
                }
            }
        } int i = 0; int i = 0; i 0 i < K i K i++ i++ i {
            for (int j = 0; j < N; j++) {
                if (A[i][j] != 0) {
                    sunuke[j]++;
                }
            }
        } {
            for (int j = 0; j < N; j++) {
                if (A[i][j] != 0) {
                    sunuke[j]++;
                }
            }
        } for (int j = 0; j < N; j++) {
                if (A[i][j] != 0) {
                    sunuke[j]++;
                }
            } int j = 0; int j = 0; j 0 j < N j N j++ j++ j {
                if (A[i][j] != 0) {
                    sunuke[j]++;
                }
            } {
                if (A[i][j] != 0) {
                    sunuke[j]++;
                }
            } if (A[i][j] != 0) {
                    sunuke[j]++;
                } A[i][j] != 0 A[i][j] A[i] A i j 0 {
                    sunuke[j]++;
                } sunuke[j]++ sunuke[j] sunuke j int ans = 0; ans 0 for (int i = 0; i < N; i++) {
            if (sunuke[i] == 0) {
                ans++;
            }
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            if (sunuke[i] == 0) {
                ans++;
            }
        } {
            if (sunuke[i] == 0) {
                ans++;
            }
        } if (sunuke[i] == 0) {
                ans++;
            } sunuke[i] == 0 sunuke[i] sunuke i 0 {
                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 N = sc.nextInt(); // すぬけ君の数
        int K = sc.nextInt(); // お菓子の種類
        int[] d = new int[K]; // 何人お菓子をもっているか
        int[][] A = new int[K][N]; // 誰がお菓子をもっているか
        int[] sunuke = new int[N];

        for (int i = 0; i < K; i++) {
            d[i] = sc.nextInt();
            for (int j = 0; j < d[i]; j++) {
                A[i][sc.nextInt() - 1]++;
            }
        }
        for (int i = 0; i < K; i++) {
            for (int j = 0; j < N; j++) {
                if (A[i][j] != 0) {
                    sunuke[j]++;
                }
            }
        }
        int ans = 0;

        for (int i = 0; i < N; i++) {
            if (sunuke[i] == 0) {
                ans++;
            }
        }
        System.out.println(ans);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt(); // すぬけ君の数
        int K = sc.nextInt(); // お菓子の種類
        int[] d = new int[K]; // 何人お菓子をもっているか
        int[][] A = new int[K][N]; // 誰がお菓子をもっているか
        int[] sunuke = new int[N];

        for (int i = 0; i < K; i++) {
            d[i] = sc.nextInt();
            for (int j = 0; j < d[i]; j++) {
                A[i][sc.nextInt() - 1]++;
            }
        }
        for (int i = 0; i < K; i++) {
            for (int j = 0; j < N; j++) {
                if (A[i][j] != 0) {
                    sunuke[j]++;
                }
            }
        }
        int ans = 0;

        for (int i = 0; i < N; i++) {
            if (sunuke[i] == 0) {
                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 N = sc.nextInt(); // すぬけ君の数
        int K = sc.nextInt(); // お菓子の種類
        int[] d = new int[K]; // 何人お菓子をもっているか
        int[][] A = new int[K][N]; // 誰がお菓子をもっているか
        int[] sunuke = new int[N];

        for (int i = 0; i < K; i++) {
            d[i] = sc.nextInt();
            for (int j = 0; j < d[i]; j++) {
                A[i][sc.nextInt() - 1]++;
            }
        }
        for (int i = 0; i < K; i++) {
            for (int j = 0; j < N; j++) {
                if (A[i][j] != 0) {
                    sunuke[j]++;
                }
            }
        }
        int ans = 0;

        for (int i = 0; i < N; i++) {
            if (sunuke[i] == 0) {
                ans++;
            }
        }
        System.out.println(ans);
    }
}