import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;

public class Main {

    public static void main(String[] args) throws Exception {

        InputStreamReader is = new InputStreamReader(System.in);
        BufferedReader reader = new BufferedReader(is);

        List<String> mylist = new ArrayList<>();

        // 標準入力からの値を変数strinputに代入
        String strinput = reader.readLine();

        while (strinput != null) {

            mylist.add(strinput);
            strinput = reader.readLine();

        }

        int n = Integer.valueOf(mylist.get(0).split(" ")[0]);
        int k = Integer.valueOf(mylist.get(0).split(" ")[1]);

        HashSet<String> hs = new HashSet<String>();
        int cnt = 0;
        while (cnt < k) {
            String arr_temp[] = mylist.get((cnt + 1) * 2).split(" ");
            for (String v : arr_temp) {
                hs.add(v);
            }
            cnt += 1;

        }
        System.out.println(n - hs.size());

    }

} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.ArrayList; ArrayList java.util import java.util.HashSet; HashSet java.util import java.util.List; List java.util public class Main {

    public static void main(String[] args) throws Exception {

        InputStreamReader is = new InputStreamReader(System.in);
        BufferedReader reader = new BufferedReader(is);

        List<String> mylist = new ArrayList<>();

        // 標準入力からの値を変数strinputに代入
        String strinput = reader.readLine();

        while (strinput != null) {

            mylist.add(strinput);
            strinput = reader.readLine();

        }

        int n = Integer.valueOf(mylist.get(0).split(" ")[0]);
        int k = Integer.valueOf(mylist.get(0).split(" ")[1]);

        HashSet<String> hs = new HashSet<String>();
        int cnt = 0;
        while (cnt < k) {
            String arr_temp[] = mylist.get((cnt + 1) * 2).split(" ");
            for (String v : arr_temp) {
                hs.add(v);
            }
            cnt += 1;

        }
        System.out.println(n - hs.size());

    }

} Main public static void main(String[] args) throws Exception {

        InputStreamReader is = new InputStreamReader(System.in);
        BufferedReader reader = new BufferedReader(is);

        List<String> mylist = new ArrayList<>();

        // 標準入力からの値を変数strinputに代入
        String strinput = reader.readLine();

        while (strinput != null) {

            mylist.add(strinput);
            strinput = reader.readLine();

        }

        int n = Integer.valueOf(mylist.get(0).split(" ")[0]);
        int k = Integer.valueOf(mylist.get(0).split(" ")[1]);

        HashSet<String> hs = new HashSet<String>();
        int cnt = 0;
        while (cnt < k) {
            String arr_temp[] = mylist.get((cnt + 1) * 2).split(" ");
            for (String v : arr_temp) {
                hs.add(v);
            }
            cnt += 1;

        }
        System.out.println(n - hs.size());

    } main {

        InputStreamReader is = new InputStreamReader(System.in);
        BufferedReader reader = new BufferedReader(is);

        List<String> mylist = new ArrayList<>();

        // 標準入力からの値を変数strinputに代入
        String strinput = reader.readLine();

        while (strinput != null) {

            mylist.add(strinput);
            strinput = reader.readLine();

        }

        int n = Integer.valueOf(mylist.get(0).split(" ")[0]);
        int k = Integer.valueOf(mylist.get(0).split(" ")[1]);

        HashSet<String> hs = new HashSet<String>();
        int cnt = 0;
        while (cnt < k) {
            String arr_temp[] = mylist.get((cnt + 1) * 2).split(" ");
            for (String v : arr_temp) {
                hs.add(v);
            }
            cnt += 1;

        }
        System.out.println(n - hs.size());

    } InputStreamReader is = new InputStreamReader(System.in); is new InputStreamReader(System.in) BufferedReader reader = new BufferedReader(is); reader new BufferedReader(is) List<String> mylist = new ArrayList<>(); mylist new ArrayList<>() String strinput = reader.readLine(); strinput reader.readLine() reader.readLine reader while (strinput != null) {

            mylist.add(strinput);
            strinput = reader.readLine();

        } strinput != null strinput null {

            mylist.add(strinput);
            strinput = reader.readLine();

        } mylist.add(strinput) mylist.add mylist strinput strinput = reader.readLine() strinput reader.readLine() reader.readLine reader int n = Integer.valueOf(mylist.get(0).split(" ")[0]); n Integer.valueOf(mylist.get(0).split(" ")[0]) Integer.valueOf Integer mylist.get(0).split(" ")[0] mylist.get(0).split(" ") mylist.get(0).split mylist.get(0) mylist.get mylist 0 " " 0 int k = Integer.valueOf(mylist.get(0).split(" ")[1]); k Integer.valueOf(mylist.get(0).split(" ")[1]) Integer.valueOf Integer mylist.get(0).split(" ")[1] mylist.get(0).split(" ") mylist.get(0).split mylist.get(0) mylist.get mylist 0 " " 1 HashSet<String> hs = new HashSet<String>(); hs new HashSet<String>() int cnt = 0; cnt 0 while (cnt < k) {
            String arr_temp[] = mylist.get((cnt + 1) * 2).split(" ");
            for (String v : arr_temp) {
                hs.add(v);
            }
            cnt += 1;

        } cnt < k cnt k {
            String arr_temp[] = mylist.get((cnt + 1) * 2).split(" ");
            for (String v : arr_temp) {
                hs.add(v);
            }
            cnt += 1;

        } String arr_temp[] = mylist.get((cnt + 1) * 2).split(" "); arr_temp mylist.get((cnt + 1) * 2).split(" ") mylist.get((cnt + 1) * 2).split mylist.get((cnt + 1) * 2) mylist.get mylist (cnt + 1) * 2 (cnt + 1) cnt 1 2 " " for (String v : arr_temp) {
                hs.add(v);
            } String v arr_temp {
                hs.add(v);
            } {
                hs.add(v);
            } hs.add(v) hs.add hs v cnt += 1 cnt 1 System.out.println(n - hs.size()) System.out.println System.out System System.out n - hs.size() n hs.size() hs.size hs String[] args args public class Main {

    public static void main(String[] args) throws Exception {

        InputStreamReader is = new InputStreamReader(System.in);
        BufferedReader reader = new BufferedReader(is);

        List<String> mylist = new ArrayList<>();

        // 標準入力からの値を変数strinputに代入
        String strinput = reader.readLine();

        while (strinput != null) {

            mylist.add(strinput);
            strinput = reader.readLine();

        }

        int n = Integer.valueOf(mylist.get(0).split(" ")[0]);
        int k = Integer.valueOf(mylist.get(0).split(" ")[1]);

        HashSet<String> hs = new HashSet<String>();
        int cnt = 0;
        while (cnt < k) {
            String arr_temp[] = mylist.get((cnt + 1) * 2).split(" ");
            for (String v : arr_temp) {
                hs.add(v);
            }
            cnt += 1;

        }
        System.out.println(n - hs.size());

    }

} public class Main {

    public static void main(String[] args) throws Exception {

        InputStreamReader is = new InputStreamReader(System.in);
        BufferedReader reader = new BufferedReader(is);

        List<String> mylist = new ArrayList<>();

        // 標準入力からの値を変数strinputに代入
        String strinput = reader.readLine();

        while (strinput != null) {

            mylist.add(strinput);
            strinput = reader.readLine();

        }

        int n = Integer.valueOf(mylist.get(0).split(" ")[0]);
        int k = Integer.valueOf(mylist.get(0).split(" ")[1]);

        HashSet<String> hs = new HashSet<String>();
        int cnt = 0;
        while (cnt < k) {
            String arr_temp[] = mylist.get((cnt + 1) * 2).split(" ");
            for (String v : arr_temp) {
                hs.add(v);
            }
            cnt += 1;

        }
        System.out.println(n - hs.size());

    }

} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;

public class Main {

    public static void main(String[] args) throws Exception {

        InputStreamReader is = new InputStreamReader(System.in);
        BufferedReader reader = new BufferedReader(is);

        List<String> mylist = new ArrayList<>();

        // 標準入力からの値を変数strinputに代入
        String strinput = reader.readLine();

        while (strinput != null) {

            mylist.add(strinput);
            strinput = reader.readLine();

        }

        int n = Integer.valueOf(mylist.get(0).split(" ")[0]);
        int k = Integer.valueOf(mylist.get(0).split(" ")[1]);

        HashSet<String> hs = new HashSet<String>();
        int cnt = 0;
        while (cnt < k) {
            String arr_temp[] = mylist.get((cnt + 1) * 2).split(" ");
            for (String v : arr_temp) {
                hs.add(v);
            }
            cnt += 1;

        }
        System.out.println(n - hs.size());

    }

}
