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

public class Main {
	static void solve() {
		int n = ni(), k = ni();
		boolean memo[] = new boolean[n];
		for(int i=0;i<k;i++) {
			int d = ni();
			for(int j=0;j<d;j++) {
				int a = ni()-1;
				memo[a] = true;
			}
		}
		long ans = 0;
		for(int i=0;i<n;i++) {
			if(!memo[i])ans++;
		}
		out.println(ans);
	}

	//constant
	static final long mod = (long) 1e9 + 7;
	static final int dx[] = { -1, 0, 1, 0 }, dy[] = { 0, -1, 0, 1 };
	static final int[] dx8 = { -1, -1, -1, 0, 0, 1, 1, 1 }, dy8 = { -1, 0, 1, -1, 1, -1, 0, 1 };
	static final int inf = Integer.MAX_VALUE / 3;
	static final long linf = Long.MAX_VALUE / 3;
	static final double dinf = Double.MAX_VALUE / 3;
	static final double eps = 1e-10;
	static final double pi = Math.PI;
	static StringBuilder sb = new StringBuilder();
	static InputStream is;
	static PrintWriter out;
	static String INPUT = "";

	//libraries
	static void reverse(int ar[]) {
		int len = ar.length;
		for (int i = 0; i < len / 2; i++) {
			int t = ar[i];
			ar[i] = ar[len - 1 - i];
			ar[len - 1 - i] = t;
		}
	}

	static void reverse(long ar[]) {
		int len = ar.length;
		for (int i = 0; i < len / 2; i++) {
			long t = ar[i];
			ar[i] = ar[len - 1 - i];
			ar[len - 1 - i] = t;
		}
	}

	static void reverse(double ar[]) {
		int len = ar.length;
		for (int i = 0; i < len / 2; i++) {
			double t = ar[i];
			ar[i] = ar[len - 1 - i];
			ar[len - 1 - i] = t;
		}
	}

	static void reverse(char ar[]) {
		int len = ar.length;
		for (int i = 0; i < len / 2; i++) {
			char t = ar[i];
			ar[i] = ar[len - 1 - i];
			ar[len - 1 - i] = t;
		}
	}

	static String getReverse(String s) {
		char c[] = s.toCharArray();
		reverse(c);
		s = String.valueOf(c);
		return s;
	}

	static <T> void reverse(List<T> ls) {
		int sz = ls.size();
		for (int i = 0; i < sz / 2; i++) {
			T t = ls.get(i);
			ls.set(i, ls.get(sz - 1 - i));
			ls.set(sz - 1 - i, t);
		}
	}

	static <T> void reverse(T[] ar) {
		int len = ar.length;
		for (int i = 0; i < len / 2; i++) {
			T t = ar[i];
			ar[i] = ar[len - 1 - i];
			ar[len - 1 - i] = t;
		}
	}

	static void sbnl() {//StringBuilderに改行文字をappendする
		sb.append("\n");
	}

	static int lowerBound(int[] a, int x) {
		int l = -1, r = a.length;
		while (r - l > 1) {
			int c = (l + r) / 2;
			if (a[c] < x) {
				l = c;
			} else {
				r = c;
			}
		}
		return r;
	}

	static int upperBound(int[] a, int x) {
		int l = -1, r = a.length;
		while (r - l > 1) {
			int c = (l + r) / 2;
			if (a[c] <= x) {
				l = c;
			} else {
				r = c;
			}
		}
		return r;
	}

	static int rlowerBound(int[] a, int x) {
		int l = -1, r = a.length;
		while (r - l > 1) {
			int c = (l + r) / 2;
			if (a[c] > x) {
				l = c;
			} else {
				r = c;
			}
		}
		return r;
	}

	static int rupperBound(int[] a, int x) {
		int l = -1, r = a.length;
		while (r - l > 1) {
			int c = (l + r) / 2;
			if (a[c] >= x) {
				l = c;
			} else {
				r = c;
			}
		}
		return r;
	}

	static int lowerBound(long[] a, long x) {
		int l = -1, r = a.length;
		while (r - l > 1) {
			int c = (l + r) / 2;
			if (a[c] < x) {
				l = c;
			} else {
				r = c;
			}
		}
		return r;
	}

	static int upperBound(long[] a, long x) {
		int l = -1, r = a.length;
		while (r - l > 1) {
			int c = (l + r) / 2;
			if (a[c] <= x) {
				l = c;
			} else {
				r = c;
			}
		}
		return r;
	}

	static int rlowerBound(long[] a, long x) {
		int l = -1, r = a.length;
		while (r - l > 1) {
			int c = (l + r) / 2;
			if (a[c] > x) {
				l = c;
			} else {
				r = c;
			}
		}
		return r;
	}

	static int rupperBound(long[] a, long x) {
		int l = -1, r = a.length;
		while (r - l > 1) {
			int c = (l + r) / 2;
			if (a[c] >= x) {
				l = c;
			} else {
				r = c;
			}
		}
		return r;
	}

	static int lowerBound(double[] a, double x) {
		int l = -1, r = a.length;
		while (r - l > 1) {
			int c = (l + r) / 2;
			if (a[c] < x) {
				l = c;
			} else {
				r = c;
			}
		}
		return r;
	}

	static int upperBound(double[] a, double x) {
		int l = -1, r = a.length;
		while (r - l > 1) {
			int c = (l + r) / 2;
			if (a[c] <= x) {
				l = c;
			} else {
				r = c;
			}
		}
		return r;
	}

	static int rlowerBound(double[] a, double x) {
		int l = -1, r = a.length;
		while (r - l > 1) {
			int c = (l + r) / 2;
			if (a[c] > x) {
				l = c;
			} else {
				r = c;
			}
		}
		return r;
	}

	static int rupperBound(double[] a, double x) {
		int l = -1, r = a.length;
		while (r - l > 1) {
			int c = (l + r) / 2;
			if (a[c] >= x) {
				l = c;
			} else {
				r = c;
			}
		}
		return r;
	}

	static int lowerBound(char[] a, char x) {
		int l = -1, r = a.length;
		while (r - l > 1) {
			int c = (l + r) / 2;
			if (a[c] < x) {
				l = c;
			} else {
				r = c;
			}
		}
		return r;
	}

	static int upperBound(char[] a, char x) {
		int l = -1, r = a.length;
		while (r - l > 1) {
			int c = (l + r) / 2;
			if (a[c] <= x) {
				l = c;
			} else {
				r = c;
			}
		}
		return r;
	}

	static int rlowerBound(char[] a, char x) {
		int l = -1, r = a.length;
		while (r - l > 1) {
			int c = (l + r) / 2;
			if (a[c] > x) {
				l = c;
			} else {
				r = c;
			}
		}
		return r;
	}

	static int rupperBound(char[] a, char x) {
		int l = -1, r = a.length;
		while (r - l > 1) {
			int c = (l + r) / 2;
			if (a[c] >= x) {
				l = c;
			} else {
				r = c;
			}
		}
		return r;
	}

	static <T> int lowerBound(List<T> ls, T x) throws RuntimeException {
		if (ls.size() == 0)
			return -1;
		if (ls.get(0) instanceof Integer) {
			return ~Collections.binarySearch(ls, x, (t1, t2) -> ((Integer) t1).compareTo((Integer) t2) >= 0 ? 1 : -1);
		} else if (ls.get(0) instanceof Long) {
			return ~Collections.binarySearch(ls, x, (t1, t2) -> ((Long) t1).compareTo((Long) t2) >= 0 ? 1 : -1);
		} else if (ls.get(0) instanceof Double) {
			return ~Collections.binarySearch(ls, x, (t1, t2) -> ((Double) t1).compareTo((Double) t2) >= 0 ? 1 : -1);
		} else {
			System.err.println(
					String.format("%s:数値でないリストを二分探索しています。", Thread.currentThread().getStackTrace()[1].getMethodName()));
			throw new RuntimeException();
		}
	}

	static <T> int upperBound(List<T> ls, T x) throws RuntimeException {
		if (ls.size() == 0)
			return -1;
		if (ls.get(0) instanceof Integer) {
			return ~Collections.binarySearch(ls, x, (t1, t2) -> ((Integer) t1).compareTo((Integer) t2) > 0 ? 1 : -1);
		} else if (ls.get(0) instanceof Long) {
			return ~Collections.binarySearch(ls, x, (t1, t2) -> ((Long) t1).compareTo((Long) t2) > 0 ? 1 : -1);
		} else if (ls.get(0) instanceof Double) {
			return ~Collections.binarySearch(ls, x, (t1, t2) -> ((Double) t1).compareTo((Double) t2) > 0 ? 1 : -1);
		} else {
			System.err.println(
					String.format("%s:数値でないリストを二分探索しています。", Thread.currentThread().getStackTrace()[1].getMethodName()));
			throw new RuntimeException();
		}
	}

	static <T> int rupperBound(List<T> ls, T x) throws RuntimeException {
		if (ls.size() == 0)
			return -1;
		if (ls.get(0) instanceof Integer) {
			return ~Collections.binarySearch(ls, x, (t1, t2) -> ((Integer) t1).compareTo((Integer) t2) < 0 ? 1 : -1);
		} else if (ls.get(0) instanceof Long) {
			return ~Collections.binarySearch(ls, x, (t1, t2) -> ((Long) t1).compareTo((Long) t2) < 0 ? 1 : -1);
		} else if (ls.get(0) instanceof Double) {
			return ~Collections.binarySearch(ls, x, (t1, t2) -> ((Double) t1).compareTo((Double) t2) < 0 ? 1 : -1);
		} else {
			System.err.println(
					String.format("%s:数値でないリストを二分探索しています。", Thread.currentThread().getStackTrace()[1].getMethodName()));
			throw new RuntimeException();
		}
	}

	static <T> int rlowerBound(List<T> ls, T x) {
		if (ls.size() == 0)
			return -1;
		if (ls.get(0) instanceof Integer) {
			return ~Collections.binarySearch(ls, x, (t1, t2) -> ((Integer) t1).compareTo((Integer) t2) <= 0 ? 1 : -1);
		} else if (ls.get(0) instanceof Long) {
			return ~Collections.binarySearch(ls, x, (t1, t2) -> ((Long) t1).compareTo((Long) t2) <= 0 ? 1 : -1);
		} else if (ls.get(0) instanceof Double) {
			return ~Collections.binarySearch(ls, x, (t1, t2) -> ((Double) t1).compareTo((Double) t2) <= 0 ? 1 : -1);
		} else {
			System.err.println(
					String.format("%s:数値でないリストを二分探索しています。", Thread.currentThread().getStackTrace()[1].getMethodName()));
			throw new RuntimeException();
		}
	}

	static int[] concat(int x, int arr[]) {
		int ret[] = new int[arr.length + 1];
		System.arraycopy(arr, 0, ret, 1, ret.length - 1);
		ret[0] = x;
		return ret;
	}

	static int[] concat(int arr[], int x) {
		int ret[] = new int[arr.length + 1];
		System.arraycopy(arr, 0, ret, 0, ret.length - 1);
		ret[ret.length - 1] = x;
		return ret;
	}

	static long[] concat(long x, long arr[]) {
		long ret[] = new long[arr.length + 1];
		System.arraycopy(arr, 0, ret, 1, ret.length - 1);
		ret[0] = x;
		return ret;
	}

	static long[] concat(long arr[], long x) {
		long ret[] = new long[arr.length + 1];
		System.arraycopy(arr, 0, ret, 0, ret.length - 1);
		ret[ret.length - 1] = x;
		return ret;
	}

	static int max(int x, int y) {
		return Math.max(x, y);
	}

	static int min(int x, int y) {
		return Math.min(x, y);
	}

	static int max(int x, int y, int z) {
		x = Math.max(x, y);
		x = Math.max(x, z);
		return x;
	}

	static int min(int x, int y, int z) {
		x = Math.min(x, y);
		x = Math.min(x, z);
		return x;
	}

	static long max(long x, long y) {
		return Math.max(x, y);
	}

	static long min(long x, long y) {
		return Math.min(x, y);
	}

	static long max(long x, long y, long z) {
		x = Math.max(x, y);
		x = Math.max(x, z);
		return x;
	}

	static long min(long x, long y, long z) {
		x = Math.min(x, y);
		x = Math.min(x, z);
		return x;
	}

	static double max(double x, double y) {
		return Math.max(x, y);
	}

	static double min(double x, double y) {
		return Math.min(x, y);
	}

	static double max(double x, double y, double z) {
		x = Math.max(x, y);
		x = Math.max(x, z);
		return x;
	}

	static double min(double x, double y, double z) {
		x = Math.min(x, y);
		x = Math.min(x, z);
		return x;
	}

	static void sort(int[] ar) {
		Arrays.sort(ar);
	}

	static void sort(long[] ar) {
		Arrays.sort(ar);
	}

	static void sort(double[] ar) {
		Arrays.sort(ar);
	}

	static void sort(char[] ar) {
		Arrays.sort(ar);
	}

	static void rsort(int[] ar) {
		Arrays.sort(ar);
		int len = ar.length;
		for (int i = 0; i < len / 2; i++) {
			int tmp = ar[i];
			ar[i] = ar[len - 1 - i];
			ar[len - 1 - i] = tmp;
		}
	}

	static void rsort(long[] ar) {
		Arrays.sort(ar);
		int len = ar.length;
		for (int i = 0; i < len / 2; i++) {
			long tmp = ar[i];
			ar[i] = ar[len - 1 - i];
			ar[len - 1 - i] = tmp;
		}
	}

	static void rsort(double[] ar) {
		Arrays.sort(ar);
		int len = ar.length;
		for (int i = 0; i < len / 2; i++) {
			double tmp = ar[i];
			ar[i] = ar[len - 1 - i];
			ar[len - 1 - i] = tmp;
		}
	}

	static void rsort(char[] ar) {
		Arrays.sort(ar);
		int len = ar.length;
		for (int i = 0; i < len / 2; i++) {
			char tmp = ar[i];
			ar[i] = ar[len - 1 - i];
			ar[len - 1 - i] = tmp;
		}
	}

	static void fill(int arr[], int x) {
		Arrays.fill(arr, x);
	}

	static void fill(long arr[], long x) {
		Arrays.fill(arr, x);
	}

	static void fill(boolean arr[], boolean x) {
		Arrays.fill(arr, x);
	}

	static void fill(double arr[], double x) {
		Arrays.fill(arr, x);
	}

	static void fill(int arr[][], int x) {
		for (int i = 0; i < arr.length; i++)
			Arrays.fill(arr[i], x);
	}

	static void fill(long arr[][], long x) {
		for (int i = 0; i < arr.length; i++)
			Arrays.fill(arr[i], x);
	}

	static void fill(double arr[][], double x) {
		for (int i = 0; i < arr.length; i++)
			Arrays.fill(arr[i], x);
	}

	static void fill(boolean arr[][], boolean x) {
		for (int i = 0; i < arr.length; i++)
			Arrays.fill(arr[i], x);
	}

	//MOD culc
	static long plus(long x, long y) {
		long res = (x + y) % mod;
		return res < 0 ? res + mod : res;
	}

	static long sub(long x, long y) {
		long res = (x - y) % mod;
		return res < 0 ? res + mod : res;
	}

	static long mul(long x, long y) {
		long res = (x * y) % mod;
		return res < 0 ? res + mod : res;
	}

	static long div(long x, long y) {
		long res = x * pow(y, mod - 2) % mod;
		return res < 0 ? res + mod : res;
	}

	static long pow(long x, long y) {
		if (y < 0)
			return 0;
		if (y == 0)
			return 1;
		if (y % 2 == 1)
			return (x * pow(x, y - 1)) % mod;
		long root = pow(x, y / 2);
		return root * root % mod;
	}

	public static void main(String[] args) throws Exception {
		is = INPUT.isEmpty() ? System.in : new ByteArrayInputStream(INPUT.getBytes());
		out = new PrintWriter(System.out);
		solve();
		out.flush();
	}

	//input
	private static byte[] inbuf = new byte[1024];
	static int lenbuf = 0, ptrbuf = 0;

	private static int readByte() {
		if (lenbuf == -1)
			throw new InputMismatchException();
		if (ptrbuf >= lenbuf) {
			ptrbuf = 0;
			try {
				lenbuf = is.read(inbuf);
			} catch (IOException e) {
				throw new InputMismatchException();
			}
			if (lenbuf <= 0)
				return -1;
		}
		return inbuf[ptrbuf++];
	}

	private static boolean isSpaceChar(int c) {
		return !(c >= 33 && c <= 126);
	}

	private static int skip() {
		int b;
		while ((b = readByte()) != -1 && isSpaceChar(b))
			;
		return b;
	}

	@SuppressWarnings("unused")
	private static double nd() {
		return Double.parseDouble(ns());
	}

	@SuppressWarnings("unused")
	private static char nc() {
		return (char) skip();
	}

	private static String ns() {
		int b = skip();
		StringBuilder sb = new StringBuilder();
		while (!(isSpaceChar(b))) {
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}

	private static char[] ns(int n) {
		char[] buf = new char[n];
		int b = skip(), p = 0;
		while (p < n && !(isSpaceChar(b))) {
			buf[p++] = (char) b;
			b = readByte();
		}
		return n == p ? buf : Arrays.copyOf(buf, p);
	}

	@SuppressWarnings("unused")
	private static char[][] nm(int n, int m) {
		char[][] map = new char[n][];
		for (int i = 0; i < n; i++)
			map[i] = ns(m);
		return map;
	}

	@SuppressWarnings("unused")
	private static int[] na(int n) {
		int[] a = new int[n];
		for (int i = 0; i < n; i++)
			a[i] = ni();
		return a;
	}

	@SuppressWarnings("unused")
	private static long[] nla(int n) {
		long[] a = new long[n];
		for (int i = 0; i < n; i++)
			a[i] = nl();
		return a;
	}

	private static int ni() {
		int num = 0, b;
		boolean minus = false;
		while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))
			;
		if (b == '-') {
			minus = true;
			b = readByte();
		}

		while (true) {
			if (b >= '0' && b <= '9') {
				num = num * 10 + (b - '0');
			} else {
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

	@SuppressWarnings("unused")
	private static long nl() {
		long num = 0;
		int b;
		boolean minus = false;
		while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))
			;
		if (b == '-') {
			minus = true;
			b = readByte();
		}

		while (true) {
			if (b >= '0' && b <= '9') {
				num = num * 10 + (b - '0');
			} else {
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

}


import java.io.IOException;
import java.io.InputStream;
import java.util.NoSuchElementException;

public class Main {

  public static void main(String[] args) {
    FastScanner sc = new FastScanner();

    int N = sc.nextInt();
    int K = sc.nextInt();

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

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

  }
}

class FastScanner {
  private final InputStream in = System.in;
  private final byte[] buffer = new byte[1024];
  private int ptr = 0;
  private int buflen = 0;

  private boolean hasNextByte() {
    if (ptr < buflen) {
      return true;
    } else {
      ptr = 0;
      try {
        buflen = in.read(buffer);
      } catch (IOException e) {
        e.printStackTrace();
      }
      if (buflen <= 0) {
        return false;
      }
    }
    return true;
  }

  private int readByte() {
    if (hasNextByte()) {
      return buffer[ptr++];
    } else {
      return -1;
    }
  }

  private static boolean isPrintableChar(int c) {
    return 33 <= c && c <= 126;
  }

  private void skipUnprintable() {
    while (hasNextByte() && !isPrintableChar(buffer[ptr])) {
      ptr++;
    }
  }

  public boolean hasNext() {
    skipUnprintable();
    return hasNextByte();
  }

  public String next() {
    if (!hasNext()) {
      throw new NoSuchElementException();
    }
    StringBuilder sb = new StringBuilder();
    int b = readByte();
    while (isPrintableChar(b)) {
      sb.appendCodePoint(b);
      b = readByte();
    }
    return sb.toString();
  }

  public int nextInt() {
    if (!hasNext()) {
      throw new NoSuchElementException();
    }
    int n = 0;
    boolean minus = false;
    int b = readByte();
    if (b == '-') {
      minus = true;
      b = readByte();
    }
    if (b < '0' || '9' < b) {
      throw new NumberFormatException();
    }
    while (true) {
      if ('0' <= b && b <= '9') {
        n *= 10;
        n += b - '0';
      } else if (b == -1 || !isPrintableChar(b)) {
        return minus ? -n : n;
      } else {
        throw new NumberFormatException();
      }
      b = readByte();
    }
  }

  public long nextLong() {
    if (!hasNext()) {
      throw new NoSuchElementException();
    }
    long n = 0;
    boolean minus = false;
    int b = readByte();
    if (b == '-') {
      minus = true;
      b = readByte();
    }
    if (b < '0' || '9' < b) {
      throw new NumberFormatException();
    }
    while (true) {
      if ('0' <= b && b <= '9') {
        n *= 10;
        n += b - '0';
      } else if (b == -1 || !isPrintableChar(b)) {
        return minus ? -n : n;
      } else {
        throw new NumberFormatException();
      }
      b = readByte();
    }
  }
}


import java.io.*;
import java.math.BigInteger;
import java.net.PortUnreachableException;
import java.util.*;

// written by luchy0120

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

        new Main().run();
    }

    static int groups = 0;
    static int[] fa;
    static int[] sz;

    static void init(int n) {
        groups = n;
        fa = new int[n];
        for (int i = 1; i < n; ++i) {
            fa[i] = i;
        }
        sz = new int[n];
        Arrays.fill(sz, 1);
    }

    static int root(int p) {
        while (p != fa[p]) {
            fa[p] = fa[fa[p]];
            p = fa[p];
        }
        return p;
    }

    static void combine(int p, int q) {
        int i = root(p);
        int j = root(q);
        if (i == j) {
            return;
        }
        if (sz[i] < sz[j]) {
            fa[i] = j;
            sz[j] += sz[i];
        } else {
            fa[j] = i;
            sz[i] += sz[j];
        }
        groups--;
    }

    int child[];
    int color[],dfn[],low[],stack[],cnt[];
    boolean vis[];
    boolean iscut[];
    int deep,top,n,m,sum,ans;
    List<Integer> g[];
    int root = 0;
    //  无向图的强连通分量
    void tarjanNonDirect(int u1) {

        int stk[] = new int[10001];
        int fatk[] = new int[10001];
        int p = 0;
        stk[p] = u1;
        fatk[p] = -1;
            p= 1;
       ot: while(p>0) {
            int u  = stk[p-1];
            int fa = fatk[p-1];

                if(dfn[u]==0) {
                    low[u] = dfn[u] = ++deep;
                }
               // stack[top++] = u;

           for (; h[u] != -1; h[u] = ne[h[u]]) {
                    int v = to[h[u]];
                    if (dfn[v] == 0) {
                        //tarjanNonDirect(v);

                        fatk[p] = u;
                        stk[p++] = v;
                        continue ot;
                    } else {
                        low[u] = Math.min(low[u], dfn[v]);
                        // 没有特判是否直接指向父亲
                        // 回边，使用dfn【v】更新low【u】,因为可能是指向父亲，而父亲的low可能比较小
                    }
                }
                --p;

                if (fa != -1) {
                    low[fa] = Math.min(low[fa], low[u]);
                    if (low[u] >= dfn[fa]) {
                        if (fa != root || ++child[fa] > 1) {     // 不是root，直接记为cut，是root，判断是否有两个儿子
                            iscut[fa] = true;
                        }
                        //++dcc_cnt;
                        // 一个割点可能会被多个点双共享
                        //  int z = -1;
                        //    do {
                        //        z = stack[--top];
                        //      dcc[dcc_cnt].add(z);
                        //    } while(z != v);
                        //   dcc[dcc_cnt].add(u);
                    }

                }

        }
    }
    int gd = 0;

    int scc_cnt = 0;
    int sccno[];

int rr =0;
//    void solve() {
//
//    }

//    int get_room(int i,int j){
//        return i/3*3 + j/3;
//    }

//    int a[][] = new int[9][9];
//    int space = 0;
//
//    boolean vis_row[][] = new boolean[9][10];
//    boolean vis_col[][] = new boolean[9][10];
//    boolean vis_room[][] = new boolean[9][10];
//    int val[][][] =new int[9][9][];
//    int prepare[][];
//
//    void dfs(int rt){
//
//    }

    int h[],to[],ne[];int ct =0;
    void add(int u,int v){
       // u--;v--;
        to[ct] = v;
        ne[ct] = h[u];
        h[u] = ct++;

    }

    void solve() {

//        while(st<end){
//            int cur = q[st++];
//            for(int i=h1[cur];i!=-1;i=ne1[i]){
//                int y = to1[i];
//                dp[y] = Math.max(dp[cur]+summ[y],dp[y]);
//                r = Math.max(dp[y],r);
//                if(--du[y]==0){
//                    q[end++] = y;
//                }
//            }
//        }
     //   print(r);

        int n = ni();
        int d[] = new int[n+1];
        int k = ni();
        for(int i=0;i<k;++i){
            int s = ni();
            for(int j=0;j<s;++j){
                d[ni()]++;
            }

        }
        int c =0;
        for(int i=1;i<=n;++i){
            if(d[i]==0){
                c++;
            }
        }
        print(c);

//        for(int i=ni();i>=1;--i){
//            int n = ni();
//            int m = ni();
//            int c = 0;
//            int from = Math.max(1,n/(m+1)+1);
//            int end = Math.min(n/2,n/m);
//            c += end-from+1;
//
//            int from1 = Math.max(1,(n+m)/(m+1));
//
//            int end1 = Math.min(n%2==0?(n/2-1):n/2,n%m==0?((n/m)-1):n/m);
//            c += end1-from1+1;

//            for(int ii=from;ii*m<=n;++ii){
//                int j  =n-ii;
//                if(ii>=j) break;
//                if((j+ii-1)/ii==m){
//                    c++;
//                }
//            }

          //  println(c);
      //  }

//        int n = ni();
//        int m  = n*(n+1)/2;
//        int k = ni();
//        int p = 0;
//
//        double x[] = new double[n];
//        double y[] = new double[n];
//
//        for(int i=0;i<n;++i){
//            x[i] = nd();
//            y[i] = nd();
//        }
//
//        List<Item> li = new ArrayList<>();
//        for(int i=0;i<n;++i){
//            for(int j=i+1;j<n;++j){
//               double r =  (x[i]-x[j])*(x[i]-x[j]) + (y[i]-y[j])*(y[i]-y[j]);
//               li.add(new Item(r,i,j));
//            }
//        }
//        Collections.sort(li,(xx,yy)->Double.compare(xx.s,yy.s));
//
//        init(n + 1);
//
//        int s = 0;
//        int c = n;
//        for (int i = 0; i < li.size(); ++i) {
//            int p1 = li.get(i).a;
//            int p2 = li.get(i).b;
//            if (root(p1) != root(p2)) {
//                combine(p1, p2);
//                c--;
//                if(c==k-1){
//                    print(roundS(Math.sqrt(li.get(i).s),2));
//                    break;
//                }
//            }
//        }

    }
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//    }

    static long mul(long a, long b, long p)
    {
        long res=0,base=a;
        while(b>0)
        {
            if((b&1L)>0)
                res=(res+base)%p;
            base=(base+base)%p;
            b>>=1;
        }
        return res;
    }

    static long mod_pow(long k,long n,long p){
        long res = 1L;
        long temp = (k%p+p)%p;
        while(n!=0L){
            if((n&1L)==1L){
                res = ((res*temp)%p+p)%p;
            }
            temp = ((temp * temp)%p+p)%p;
            n = n>>1L;
        }
        return res%p;
    }
    public static String roundS(double result, int scale){
        String fmt = String.format("%%.%df", scale);
        return String.format(fmt, result);
    }

//    void solve() {
//
//        for(int i=0;i<9;++i) {
//            for (int j = 0; j < 9; ++j) {
//                int v = ni();
//                a[i][j] = v;
//                if(v>0) {
//                    vis_row[i][v] = true;
//                    vis_col[j][v] = true;
//                    vis_room[get_room(i, j)][v] = true;
//                }else{
//                    space++;
//                }
//            }
//        }
//
//
//        prepare = new int[space][2];
//
//        int p = 0;
//
//        for(int i=0;i<9;++i) {
//            for (int j = 0; j < 9; ++j) {
//                if(a[i][j]==0){
//                    prepare[p][0] = i;
//                    prepare[p][1]= j;p++;
//                    List<Integer> temp =new ArrayList<>();
//                    for(int k=1;k<=9;++k){
//                        if(!vis_col[j][k]&&!vis_row[i][k]&&!vis_room[get_room(i,j)][k]){
//                            temp.add(k);
//                        }
//                    }
//                    int sz = temp.size();
//                    val[i][j] = new int[sz];
//                    for(int k=0;k<sz;++k){
//                        val[i][j][k] = temp.get(k);
//                    }
//                }
//            }
//        }
//        Arrays.sort(prepare,(x,y)->{
//           return Integer.compare(val[x[0]][x[1]].length,val[y[0]][y[1]].length);
//        });
//        dfs(0);
//
//
//
//
//
//
//
//
//
//
//    }

    InputStream is;
    PrintWriter out;

    void run() throws Exception {
        //is = new FileInputStream(new File("C:\\Users\\Luqi\\Downloads\\P3387_9.in"));
        is = System.in;
        out = new PrintWriter(System.out);

        solve();
        out.flush();
    }

    private byte[] inbuf = new byte[1024];
    public int lenbuf = 0, ptrbuf = 0;

    private int readByte() {
        if (lenbuf == -1) throw new InputMismatchException();
        if (ptrbuf >= lenbuf) {
            ptrbuf = 0;
            try {
                lenbuf = is.read(inbuf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (lenbuf <= 0) return -1;
        }
        return inbuf[ptrbuf++];
    }

    private boolean isSpaceChar(int c) {
        return !(c >= 33 && c <= 126);
    }

    private int skip() {
        int b;
        while ((b = readByte()) != -1 && isSpaceChar(b)) ;
        return b;
    }

    private double nd() {
        return Double.parseDouble(ns());
    }

    private char nc() {
        return (char) skip();
    }

    private char ncc() {
        int b = readByte();
        return (char) b;
    }

    private String ns() {
        int b = skip();
        StringBuilder sb = new StringBuilder();
        while (!(isSpaceChar(b))) { // when nextLine, (isSpaceChar(b) && b != ' ')
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }

    private char[] ns(int n) {
        char[] buf = new char[n];
        int b = skip(), p = 0;
        while (p < n && !(isSpaceChar(b))) {
            buf[p++] = (char) b;
            b = readByte();
        }
        return n == p ? buf : Arrays.copyOf(buf, p);
    }

    private String nline() {
        int b = skip();
        StringBuilder sb = new StringBuilder();
        while (!isSpaceChar(b) || b == ' ') {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }

    private char[][] nm(int n, int m) {
        char[][] a = new char[n][];
        for (int i = 0; i < n; i++) a[i] = ns(m);
        return a;
    }

    private int[] na(int n) {
        int[] a = new int[n];
        for (int i = 0; i < n; i++) a[i] = ni();
        return a;
    }

    private long[] nal(int n) {
        long[] a = new long[n];
        for (int i = 0; i < n; i++) a[i] = nl();
        return a;
    }

    private int ni() {
        int num = 0, b;
        boolean minus = false;
        while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) {
        }
        ;
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        while (true) {
            if (b >= '0' && b <= '9') num = (num << 3) + (num << 1) + (b - '0');
            else return minus ? -num : num;
            b = readByte();
        }
    }

    private long nl() {
        long num = 0;
        int b;
        boolean minus = false;
        while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) {
        }
        ;
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        while (true) {
            if (b >= '0' && b <= '9') num = num * 10 + (b - '0');
            else return minus ? -num : num;
            b = readByte();
        }
    }

    void print(Object obj) {
        out.print(obj);
    }

    void println(Object obj) {
        out.println(obj);
    }

    void println() {
        out.println();
    }

    void printArray(int a[],int from){
        int l = a.length;
        for(int i=from;i<l;++i){
            print(a[i]);
            if(i!=l-1){
                print(" ");
            }
        }
        println();
    }

    void printArray(long a[],int from){
        int l = a.length;
        for(int i=from;i<l;++i){
            print(a[i]);
            if(i!=l-1){
                print(" ");
            }
        }
        println();
    }
}


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[n];
    int[]a = new int[k];
    int[]s = 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();
    			 	s[a[i]-1]++;
    		}
    }
    int cou = 0;
    for(int i=0; i<n; i++) {
    	if(s[i] == 0){
    		cou++;
    	}
    }
    		System.out.println(cou);
    		}
}


import java.util.HashSet;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        int k = Integer.parseInt(sc.next());
        HashSet<Integer> hs = new HashSet<>();
        for (int i = 0; i < n; i++) {
            int d = Integer.parseInt(sc.next());
            for (int j = 0; j < d; j++) {
                hs.add(Integer.parseInt(sc.next()));
            }
        }
        int answer = n - hs.size();
        System.out.println(answer);
        sc.close();
    }

}


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];
    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[j] = sc.nextInt();
        		sunuke[a[j]-1]++;
        	}
    }
    int cou = 0;
    for(int i=0; i<n; i++) {
    	if(sunuke[i] == 0){
    		cou++;
    	}
    }

    System.out.println(cou);
    }
}


#include <cstdio>

int n, k, a[105];

int read() {
    int x = 0, f = 1; char s;
    while((s = getchar()) < '0' || s > '9') if(s == '-') f = -1;
    while(s >= '0' && s <= '9') {x = (x << 1) + (x << 3) + (s ^ 48); s = getchar();}
    return x * f;
}

int main() {
    int x;
    n = read(), k = read();
    for(int i = 1; i <= k; ++ i) {
        x = read();
        for(int j = 1; j <= x; ++ j) a[read()] = 1;
    }
    x = 0;
    for(int i = 1; i <= n; ++ i)
        if(! a[i]) ++ x;
    printf("%d\n", x);
    return 0;
}


#include <cstdio>
#include <cstring>

inline int read(){
	int x=0,f=1;
	char ch=getchar();
	while(ch>'9' || ch<'0'){
		if(ch=='-')
		f=-1;
		ch=getchar();
	}
	while(ch>='0'&&ch<='9'){
		x=x*10+ch-48;
		ch=getchar();
	}
	return x*f;
}
int n,k,cnt;
bool vis[105];

int main(){
	memset(vis,true,sizeof(vis));
	n=read();k=read();
	for(int i=1;i<=k;++i){
		int d=read();
		for(int i=1;i<=d;++i)
		vis[read()]=false;
	}
	for(int i=1;i<=n;++i)
	if(vis[i])++cnt;
	printf("%d\n",cnt);
}


#include <cstdio>

int N,K;

bool has[102];

int main(){
    scanf("%d%d",&N,&K);

    for(int i=0;i<K;i++){
        int k;
        scanf("%d",&k);
        for(int i=0;i<k;i++){
            int d;
            scanf("%d",&d);
            has[d]=true;
        }
    }

    int ans=0;
    for(int i=1;i<=N;i++) if (!has[i]) ans++;

    printf("%d\n",ans);

    return 0;
}


#include<bits/stdc++.h>
#include<vector>
using namespace std;
using ll = long long;
using P = pair<int, int>;

int main(){
    int n, k;
    cin >> n >> k;
    int N[n];
    for(int i=0; i<k; i++){
        int m;
        cin >> m;
        for(int j=0; j<m; j++){
            int a;
            cin >> a;
            N[a-1] = 1;
        }
    }

    int ans=0;
    for(int i=0; i<n; i++){
        if(N[i] == 0) ans++;
    }

    cout << ans << endl;

    return 0;
}


#include<bits/stdc++.h>
#include<vector>
using namespace std;
using ll = long long;
using P = pair<int, int>;

int main(){
    int n, k;
    cin >> n >> k;
    int N[n];
    for(int i=0; i<k; i++){
        int m;
        cin >> m;
        for(int j=0; j<m; j++){
            int a;
            cin >> a;
            N[a-1] =1;
        }
    }

    int ans=0;
    for(int i=0; i<n; i++){
        if(N[i] == 0) ++ans;
    }

    cout << ans << endl;

    return 0;
}


#include<bits/stdc++.h>
#include<vector>
using namespace std;
using ll = long long;
using P = pair<int, int>;

int main(){
    int n, k;
    cin >> n >> k;
    int N[n];
    for(int i=0; i<k; i++){
        int m;
        cin >> m;
        for(int j=0; j<m; j++){
            int a;
            cin >> a;
            N[a-1] =1;
        }
    }

    int ans=0;
    for(int i=0; i<n; i++){
        if(N[i] == 0) ans++;
    }

    cout << ans << endl;

    return 0;
}


#include<stdio.h>
int main(void)
{
  int n,k,p,d,a[101]={0},i,j,m=0;
  scanf("%d%d",&n,&k);
  for(i=0;i<k;i++){
    scanf("%d",&p);
    for(j=0;j<p;j++){
      scanf("%d",&d);
      a[d]=1;
    }
  }
  for(i=1;i<=n;i++){
    if(a[i]==0){
      m++;
    }
  }
  printf("%d\n",m);
  return 0;
}


#include <stdio.h>

int main(void){
   int N, K;

   scanf("%d %d",&N,&K);

   int d[K], A[K][N], i, j, B[N], ans=0;

   for(i=0;i<K;i=i+1){
      scanf("%d",&d[i]);

      for(j=0;j<d[i];j=j+1){
         scanf("%d",&A[i][j]);
      }
   }

   for(i=0;i<N;i=i+1)
      B[i]=0;

   for(i=0;i<K;i=i+1){
      for(j=0;j<d[i];j=j+1){
         B[(A[i][j]-1)]=B[(A[i][j]-1)]+1;
      }
   }

   for(i=0;i<N;i=i+1){
      if(B[i]==0)
      ans=ans+1;
   }

   printf("%d\n",ans);

   return 0;
}


#include <float.h>
#include <inttypes.h>
#include <limits.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#include <math.h>
#ifdef __cplusplus
#include <bits/stdc++.h>
#endif

bool arr[101];

uint32_t nextpint(void){ char c=getc_unlocked(stdin); while(c<'0'||'9'<c) c=getc_unlocked(stdin); uint32_t x=0; while('0'<=c && c<='9'){ x=x*10+c-'0'; c=getc_unlocked(stdin); } return x; }

int main(void){
	uint32_t n=nextpint();
	uint32_t k=nextpint();
	for(uint32_t i=k; i>0; i--){
		uint32_t d=nextpint();;
		for(uint32_t j=d; j>0; j--){
			uint32_t a=nextpint();
			arr[a]=true;
		}
	}
	uint32_t ans=0;
	for(uint32_t i=n; i>0; i--){
		if(!arr[i]) ans++;
	}
	printf("%"PRIu32"\n", ans);
}


#include<stdio.h>

int main(void){
  int n,k;
  scanf("%d %d",&n,&k);
  int p[101]={},d[k];
  for(int i=0;i<k;i++){
    scanf("%d",&d[i]);
      for(int j=0;j<d[i];j++){
        int pn=0;
        scanf("%d",&pn);
        p[pn]++;
      }
  }

  int c=0;
  for(int i=0;i<n;i++){
    if(p[i]==0){
      c++;
    }
  }

  printf("%d\n",c);
  return 0;
}


#include<stdio.h>

int main(void){
  int n,k;
  scanf("%d %d",&n,&k);
  int p[101]={},d[k];
  for(int i=0;i<k;i++){
    scanf("%d",&d[i]);
      for(int i=0;i<d;i++){
        int pn=0;
        scanf("%d",&pn);
        p[pn]++;
      }
  }

  int c=0;
  for(int i=0;i<n;i++){
    if(p[i]==0){
      c++;
    }
  }

  printf("%d\n",c);
  return 0;
}


#include<stdio.h>

int main(void){
  int n,k;
  scanf("%d %d",&n,&k);
  int p[n]={},d[k];
  for(int i=0;i<k;i++){
    scanf("%d",&d[i])
      for(int i=0;i<d;i++){
        int pn=0;
        scanf("%d",&pn);
        p[pn]++;
      }
  }

  int c=0;
  for(int i=0;i<n;i++){
    if(p[i]==0){
      c++;
    }
  }

  printf("%d\n",c);
  return 0;
}


function main(input){

    inputArray=input.split('\n');
    NK=inputArray[0].split(' ');
    N = parseInt(NK[0]);
    K = parseInt(NK[1]);
    out=0;
    sunukeArray=new Array(N-1);//all sunuke
    for(i=0;i<N;i++){
        sunukeArray[i]='0';
    }

    for(i=1;i<=2*K;i=i+2){
        kashiSnk=inputArray[i+1].split(' ');//sunuke have kashi
        for(j=0;j<parseInt(inputArray[i]);j++){
            sunukeArray[parseInt(kashiSnk[j])-1]='1';
        }
        kashiSnk.length=0;
    }

    for(i=0;i<N;i++){
        if(sunukeArray[i]=='0'){
            out++;
        }
    }
    console.log(out);
}

main(require("fs").readFileSync("/dev/stdin", "utf8"));


const Main = (input) => {
    const lines = input.split('\n')
    line0=lines[0].trim().split(" ")
    N=parseInt(line0[0])
    K=lines[1]
    a=new Array(N)
    for (i=2;i<lines.length;i=i+2){
        line=lines[i].trim().split(" ").map(n=>parseInt(n))
        for(j=0;j<line.length;j++){
            a[line[j]-1]=-2
        }
    }
    ans=0
    for( i=0 ;i<a.length;i++){
        if(a[i]!==-2){
            ans=ans+1
        }
    }
    console.log(ans)
}

Main(require('fs').readFileSync('/dev/stdin', 'utf8'))


const Main = (input) => {
  const tmp = input.trim().split('\n')
  const N = parseInt(tmp[0].split(' ')[0])
  const K = parseInt(tmp[0].split(' ')[1])

  const sunuke = {}

  for (let i = 1; i <= N; ++i) {
    sunuke[i] = ''
  }

  for (let j = 1; j <= K; j++) {
    const sweets = (j * 2 - 1).toString()
    const sunukeNum = tmp[j * 2].split(' ').map(n => n.toString())
    sunukeNum.forEach(elem => {
      sunuke[elem] += sweets
    })
  }

  let result = 0

  for (let i = 1; i <= N; ++i) {
    if (sunuke[i].length === 0) {
      result += 1
    }
  }

  console.log(result)
  return result
}

Main(require('fs').readFileSync('/dev/stdin', 'utf8'))


function Main(input) {
  input=input.split("\n");

  const N=input[0].split(' ')[0]-0;
  const K=input[0].split(' ')[1]-0;
  var temp;
  var array=new Array(N+1);
  array.fill(false);
  for(var i=1;i<=K*2;i+=2){
    temp=input[i].split(' ').map(e=>{return e});
    temp.forEach(e=>{array[e]=true;});
  }
  var ans=0;
  array.forEach(e=>{
    if(!e){ans++;}
  });
  console.log(ans-1);

}

//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


function Main(input){
    input=input.split("\n");  //ここまで必須
    var gyo=input.length;
    inputA=input[0].split(" ");
    var retu=new Array(inputA[0]);
    for (i=1;i<gyo;i=i+2){
        var inputB=input[i+1].split(" ");
        for (j=0;j<inputB.length;j++){
            retu[inputB[j]-1]=1
        }
    }
    var count=0;
    for (k=0;k<inputA[0];k++){
        if (retu[k]!=1){
            count++
        }
    }
    console.log(count);}

Main(require("fs").readFileSync("/dev/stdin","utf8"));


function main(arg) {
  // var str = arg.trim();
  const array = arg.trim().split("\n");
  const first = array[0].split(" ");
  // const first = array[0].split(" ");
  const N = parseInt(first[0]);
  const K = parseInt(first[1]);
  let rsultArray = new Array(N);

  let counter = 0;
  for (let i = 0; i < K; i++) {
    let okashi = parseInt(array[counter + 1].trim().split("\n"));
    let person = array[counter + 2].trim().split("\n");
    for (let j = 0; j < person.length; j++) {
      rsultArray.splice(person[j] - 1, person[j] - 1, "1"); // 二番目に挿入
    }
    // console.log(okashi);
    // console.log(person);
    counter += 2;
  }

  let answer = 0;
  for (let k = 0; k < rsultArray.length; k++) {
    if (!rsultArray[k]) {
      answer++;
    }
  }
  console.log(answer);
}
main(require("fs").readFileSync("/dev/stdin", "utf8"));
// main("3 2\n2\n1 3\n1\n3");
// main("3 3\n1\n3\n1\n3\n1\n3");
//https:/ / atcoder.jp / contests / abc166 / tasks / abc166_a;


package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var (
	scanner = bufio.NewScanner(os.Stdin)
	w       = bufio.NewWriter(os.Stdout)
)

func readInt() (read int) {
	scanner.Scan()
	read, err := strconv.Atoi(scanner.Text())
	if err != nil {
		panic(err)
	}
	return
}

func main() {
	scanner.Split(bufio.ScanWords)
	defer w.Flush()

	n := readInt()
	k := readInt()

	okasi := make([]int, n)

	for i := 0; i < k; i++ {
		d := readInt()
		for j := 0; j < d; j++ {
			a := readInt()
			okasi[a-1] = 1
		}
	}
	sum := 0
	for _, i := range okasi {
		sum += i
	}

	fmt.Fprintln(w, n-sum)
}


package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"strconv"
)

func scanInt() int {
	sc.Scan()
	i, _ := strconv.Atoi(sc.Text())
	return i
}

func scanInt64() int64 {
	sc.Scan()
	i, _ := strconv.ParseInt(sc.Text(), 10, 64)
	return i
}

func scanInts(n int) []int {
	res := make([]int, n)
	for i := 0; i < n; i++ {
		res[i] = scanInt()
	}
	return res
}

func scanInts64(n int) []int64 {
	res := make([]int64, n)
	for i := range res {
		res[i] = scanInt64()
	}
	return res
}

func scanText() string {
	sc.Buffer([]byte{}, math.MaxInt64)
	sc.Scan()
	return sc.Text()
}

var sc = bufio.NewScanner(os.Stdin)

func main() {
	sc.Split(bufio.ScanWords)
	n, k := scanInt(), scanInt()
	a := map[int]int{}
	for i := 0; i < k; i++ {
		d := scanInt()
		for j := 0; j < d; j++ {
			p := scanInt()
			a[p] = 1
		}
	}
	fmt.Println(n - len(a))
}


package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func nextInt() int {
	var i int
	if sc.Scan() {
		if num, err := strconv.Atoi(sc.Text()); err == nil {
			i = num
		}
	}
	return i
}

func contains(s []int, e int) bool {
	for _, v := range s {
		if e == v {
			return true
		}
	}
	return false
}

func main() {
	sc.Split(bufio.ScanWords)
	var allSunukeCount, okahiCount = nextInt(), nextInt()
	var okashiSunukes []int
	for i := 0; i < okahiCount; i++ {
		sunukeCount := nextInt()
		for i := 0; i < sunukeCount; i++ {
			sunukeNum := nextInt()
			if !contains(okashiSunukes, sunukeNum) {
				okashiSunukes = append(okashiSunukes, sunukeNum)
			}
		}
	}
	fmt.Println(allSunukeCount - len(okashiSunukes))
}


package main

import "fmt"

func main() {
  var n, k int
  fmt.Scanf("%d %d", &n, &k)

  a := make([]int, n)

  for i:=0; i<k; i++ {
    var d int
    fmt.Scan(&d)
    for j:=0; j<d; j++ {
      var s int
      fmt.Scan(&s)
      a[s-1]+=1
    }
  }

  var r int
  for i:=0; i<k; i++ {
    if a[i] == 0 {
      r+=1
    }
  }

  fmt.Println(r)
}


package main

import "fmt"

func main() {
	var n, k, d, tmp int
  	fmt.Scan(&n, &k)
  	a := map[int]int{}

    for i := 0; i < k; i++ {
      fmt.Scan(&d)

      for j := 0; j < d; i++ {
        fmt.Scan(&tmp)
        _, err := a[tmp]
        if err {
        	a[tmp]++
        }else {
        	a[tmp] = 0
        }
      }
    }
  fmt.Println(n - len(a))
}


package main

import "fmt"

func main() {
	var n, k, d, tmp int
  	fmt.Scan(&n, &k)

    for i := 0; i < k; i++ {
      fmt.Scan(&d)
      a := map[int]int{}

      for j := 0; j < d; i++ {
        fmt.Scan(&tmp)
        _, err := a[tmp]
        if err {
        	a[tmp]++
        }else {
        	a[tmp] = 0
        }
      }
    }
  fmt.Println(n - len(a))
}


n, k = gets.split.map(&:to_i)
h = Hash.new(0)
d = []
a = []
k.times do
  d = gets.to_i
  gets.split.map(&:to_i).each { |i| h[i] += 1 }
end

puts n - h.size


N, K = gets.split.map(&:to_i)
A = []
K.times {
  d = gets.to_i
  A << gets.split.map(&:to_i)
}
a = (1..N).to_a
A = A.flatten
ans = a - A
puts ans.count


n, k = readline.split(' ').map(&:to_i)

a = Array.new(k)

a.map! do
  readline
  readline.split(' ').map(&:to_i)
end

p n - a.flatten.uniq.size


n,k=gets.split.map &:to_i
ans=[]
k.times{|i|
gets
ans << (gets.split.map &:to_i)
}
puts n-ans.uniq.size


N,K = gets.split.map(&:to_i)
has = Array.new(N, false)

K.times {
  gets
  a = gets.split.map(&:to_i)
  a.each { |_a|
    has[_a-1] = true
  }
}

cnt = 0
#p has
has.each { |v|
  if v == false
    cnt = 1
  end
}

puts cnt


nk = gets.chomp

nkarr = nk.split(" ")

n = nkarr[0].to_i
k = nkarr[1].to_i

d = []
d_n = []
count = 0
while count < k do
    temp_k = gets.chomp.to_i
    temp_n = gets.chomp
    temp_n = temp_n.split(" ")
    temp_n = temp_n.map { |n|
        n.to_i
    }
    d << temp_k
    d_n << temp_n
    count += 1
end

dn_uniq = d_n.flatten!.uniq
p(dn_uniq)

ans = 0
for i in 1..n do
    if dn_uniq.include? i
       ans += 1
    end
end

if ans == 0
    puts(0)
    exit
end

ans = n - ans
puts(ans)


#![allow(unused_imports)]
#![allow(unused_macros)]
#![allow(non_snake_case)]
#![allow(dead_code)]
#![allow(unused_variables)]
#![allow(unused_mut)]
#![allow(unused_assignments)]
use proconio::input;
use proconio::marker::Usize1;
use std::collections::*;
use std::cmp::*;
use std::f64::consts::*;

const MOD: u64 = 1000000007;
const INF: usize = std::usize::MAX / 4;

fn main() {
    input! {
        N: usize,
        K: usize,
    }

    let mut cnt = vec![0; N];

    for _ in 0..K {
        input! {
            D: usize,
            A: [Usize1; D],
        }
        for &a in &A {
            cnt[a] += 1;
        }
    }

    println!("{}", cnt.iter().filter(|&&c| c == 0).count());
}


use proconio::fastout;
use proconio::input;
#[allow(unused_imports)]
use proconio::marker::*;

#[fastout]
fn main() {
    input! {
        n: usize,
        k: usize,
    }

    let mut a = vec![];
    for _ in 1..=k {
        input! {
            d: usize,
            mut ad: [usize; d],
        }
        a.append(&mut ad);
    }
    a.sort();
    a.dedup();
    println!("{}", n - a.len());
}


use itertools::Itertools as _;
use proconio::{input, marker::Usize1};

fn main() {
    input! {
        n: usize,
        ass: [[Usize1]],
    }

    let ans = n - ass.into_iter().flatten().unique().count();
    println!("{}", ans);
}


#![allow(unused_imports)]
#![allow(unused_variables)]

use itertools::Itertools;
use proconio::{fastout, input};
use std::collections::HashMap;

#[fastout]
fn main() {
    input! {
        n: usize, k: usize,
        a: [[usize]; k],
    }
    // annotate for rust-analyzer
    let (n, k) = (n as usize, k as usize);
    let a: Vec<Vec<usize>> = a;

    let mut map = HashMap::<usize, usize>::new();
    for i in 0..k {
        for di in 0..a[i].len() {
            *map.entry(di).or_insert(0) += 1;
        }
    }

    println!("{}", n - map.len());
}


// -*- coding:utf-8-unix -*-

use proconio::input;

fn main() {
    input! {
        n: u16,
        k: u16,
    }

    let mut sunuke = vec![0; n as usize];
    for i in 0..k {
        input! {
            dd: u16,
            aa: [u16; dd as usize],
        }
        for j in 0..dd {
            sunuke[j as usize] += 1;
        }
    }
    println!("{}", sunuke.into_iter().filter(|&s| s == 0).count());
}


use proconio::input;
use proconio::marker::Chars;
use std::collections::HashMap;
use std::vec::Vec;

fn main() {
	input! {
		n: usize,
		k: usize,
	}
	//   お菓子図鑑
	let mut map: HashMap<usize, usize> = HashMap::new();
	for i in 0..n {
		let _ = map.entry(i).or_insert(0);
	}

	// すぬけくんのポケットにあるお菓子を調べる
	for _ in 0..k {
		input! {
			d: usize,
			v: [usize; d],
		}
		// ポケットをチェック
		for a in v.iter() {
			let entry = map.entry(a - 1).or_insert(0);
			*entry += 1;
		}
	}

	// お菓子を持っていいないカウント
	let mut ans = 0;
	for (_, &v) in map.iter() {
		if v == 0 {
			ans += 1;
		}
		3 3
		1
		3
		1
		3
		1
		3}

	println!("{}", ans);
}


let inp = readLine()!.split(separator: " ").map { Int($0)! }
let (N, K) = (inp[0], inp[1])
let As = (1...K).map { _ -> [Int] in
    _ = readLine()
    return readLine()!.split(separator: " ").map { Int($0)! }
}

print(N - Set(As.flatMap{$0}).count)


let nl = readLine()!.split(separator: " ").map { Int($0)! }
let n = nl[0], k = nl[1]
var a = [[Int]](repeating: [Int](), count: n)
for di in 1..<k+1 {
  _ = readLine()
  let nr = readLine()!.split(separator: " ").map { Int($0)! }
  for i in nr {
    a[i-1] = a[i-1] + [di]
  }
}
print(a.filter { $0.isEmpty }.count)


func main() {
    let inputs = readLine()!.split(separator: " ")
    let N = Int(inputs[0])!
    let K = Int(inputs[1])!
    var nums = Array(repeating: 0, count: N)
    for _ in 0..<K {
        let _ = readLine()!
        let A = readLine()!.split(separator: " ").map { Int($0)! }
        for a in A {
            nums[a - 1] += 1
        }
    }
    let output = nums.filter { $0 == 0 }.count
    print(output)
}

main()


let NK = readLine()!.components(separatedBy: " ")
let N = Int(NK[0])!
let K = Int(NK[1])!

var result: [Bool] = [Bool](repeating: false, count: N)
var d = readLine()

while d != nil {
   let line = readLine()!.components(separatedBy: " ").map{ Int($0)! }
   for peopleNum in line {
      result[peopleNum - 1] = true
   }
   d = readLine()
}

print(result.filter{ $0 == false}.count)


import Foundation

let nk = readLine()!.split(separator:" ").map{Int($0)!}
var sets: Set<Int> = []
for _ in 1...nk[1] - 1{
  let _ = readLine()!
  let A = readLine()!.split(separator:" ").map{Int($0)!}
  for i in A{
  sets.insert(i)
  }
}
print(nk[0] - sets.count)


import Foundation

let nk = readLine()!.split(separator:" ").map{Int($0)!}
var sets: Set<Int> = []
for _ in 1...nk[1] - 1{
  let c = readLine()!
  let A = readLine()!.split(separator:" ").map{Int($0)!}
  for i in A{
  sets.insert(i)
  }
}
print(nk[0] - sets.count)


import * as fs from 'fs';

const input = fs.readFileSync('/dev/stdin', 'utf8');
const args: string[][] = input.split('\n').map(l => l.split(' '));

const [n, k] = args[0].map(x => parseInt(x));
const snuke: boolean[] = Array(n).fill(false);
for (let i = 0; i < k; i++) {
    const d = parseInt(args[2 * i + 1][0]);
    for (let j = 0; j < d; j++) {
        snuke[parseInt(args[2 * i + 2][j]) - 1] = true;
    }
}

const cnt = snuke.filter(x => x === false).length;

console.log(cnt);


import * as fs from 'fs';

namespace AtCoder {
    export interface Paramable {
        readonly args: string[][];
    }

    export interface Task {
        main(this: Task): void;
    }
}

namespace AtCoder.abc001 {
    export class TaskA implements AtCoder.Task, AtCoder.Paramable {
        public constructor(public readonly args: string[][]) {
        }

        public main(this: TaskA): void {
            const [n, k]: number[] = this.args[0].map(Number);
            const set = new Set();

            for (let i = 2; i < k * 2+1; i = i + 2) {
                const val: number[] = this.args[i].map(Number);
                val.forEach(x => {
                    set.add(x)
                })
            }
            console.log(n - set.size);
        }
    }

    const args: string[][] = fs.readFileSync('/dev/stdin', 'utf8').trim().split('\n').map(r => r.split(' '));
    const task: AtCoder.Task = new TaskA(args);
    task.main();
}


import { count } from 'console';

process.stdin.resume();
process.stdin.setEncoding('utf8');

// 標準入力取込
let gInput = '';
process.stdin.on('data', (chunk) => (gInput += chunk));
process.stdin.on('end', () => main(gInput.split(/\r?\n/)));

// 解答
function main(inputs: string[]): void {
  const [n, k] = inputs[0].split(' ').map(Number);
  let list = new Array(n).fill(0);

  for (let i = 1; i <= k; i++) {
    let treatList = inputs[2 * i].split(' ').map(Number);
    for (let j = 0; j < treatList.length; j++) {
      if (list[treatList[j] - 1] === 0) {
        list[treatList[j] - 1] = 1;
      }
    }
  }

  console.log(list.filter((num) => num === 0).length);
}


import * as fs from 'fs'
import {debug} from '../../../util'

const input = fs.readFileSync('/dev/stdin', 'utf8').trim().split('\n')
const output = (x: any) => console.log(x)
// debug(input)
const [N, K] = input[0].split(' ').map(n => parseInt(n, 10))

const set = new Set()
for (let i = 0; i < K*2; ++i) {
    if (i % 2 !== 0 || i === 0) continue
    const m = input[i].split(' ').map(n => parseInt(n, 10))
    for (let j = 0; j < m.length; ++j) {
        set.add(m[j])
    }
}
// debug(set)
output(N - set.size)


import * as fs from 'fs'

export function TrickOrTreat(input: number[], excludes: number[][]):number {
    excludes.forEach(exclude => {
        // inputがexcludeに存在しなければ残す
        input = input.filter(num => exclude.indexOf(num) === -1)
        if(input.length === 0) {
            return 0
        }
    })
    return input.length
}

const input = fs.readFileSync('/dev/stdin', 'utf8').split('\n')

const firstLine = input[0].split(' ').map(c => parseInt(c))
const peopleNum = firstLine[0]
const peopleArray = [...Array(peopleNum).keys()].map(num => num + 1)
const treatTypeNum = firstLine[1]
const excludes: number[][] = []
// 2 4 6 ...
for(let i = 0;i<treatTypeNum-1;i++) {
    const array = input[i+2].split(' ').map(c => parseInt(c))
    excludes.push(array)
}

console.log(TrickOrTreat(peopleArray, excludes))


function Main(input) {
    const _input = input.split("\n")
    const NK = input[0].split(" ")
    const N = NK[0]
    // const K = NK[1]

    let ans = new Array(Number(N)).fill(0)
    for (let k = 2; k < _input.length; k += 2) {
        const hito = _input[k].split(" ");
        hito.forEach(h => {
            ans[Number(h)-1]++
        })
    }
    console.log(ans.filter(e => e === 0).length)

}
// Main()
Main(require("fs").readFileSync("/dev/stdin", "utf8").trim());


def main():
    s = open(0).read()
    b = s.count('-')
    _, *c, = map(int, s.replace('-', '').split())
    z = c.count(0)
    d = min(c)
    e = sum(c)

    if b % 2 == 0 or z > 0:
        print(e)
    else:
        print(e - 2 * d)

if __name__ == '__main__':
    main()


def main():
    s = open(0).read()
    b = s.count('-')
    z = s.count(' 0 ')
    _, *c, = map(int, s.replace('-', '').split())

    d = min(c)
    e = sum(c)

    if b % 2 == 0 or z > 0:
        print(e)
    else:
        print(e - 2 * d)

if __name__ == '__main__':
    main()


def main():
    N = int(input())
    A = list(map(int, input().split()))

    B = list(map(abs, A))
    C = [a for a in A if a < 0]
    if len(C) % 2 == 0:
        print(sum(B))
    else:
        print(sum(B) - min(B)*2)

if __name__ == "__main__":
    main()


N=int(input())
A=list(map(int,input().split()))

plus=0
zero=0
minus=0

for i in range(N):
    if A[i]>0:
        plus+=1
    elif A[i]<0:
        minus+=1
    else:
        zero+=1
ans=0
m=10*9+10
for i in range(N):
    ans+=abs(A[i])
    m=min(m,abs(A[i]))

if minus%2==0 or zero>0:
    pass
else:
    ans=ans-2*m

print(ans)


N = int(input())
A = list(map(int, input().split()))

souwa = 0
cnt = 0
keep = 1e9

for i in range(N):
    if A[i] < 0:
        cnt += 1
        A[i] *= (-1)

    souwa += A[i]
    keep = min(keep, A[i])

print(souwa - 2 * keep * (cnt % 2))


import numpy as np

n=int(input())
A=np.array(list(map(int,input().split())))
A = np.abs(A)

if 0 in A:
  print(np.sum(A))
else:
  print(np.sum(A) - np.min(A))


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.BufferedWriter;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        DFlippingSigns solver = new DFlippingSigns();
        solver.solve(1, in, out);
        out.close();
    }

    static class DFlippingSigns {
        public void solve(int testNumber, InputReader in, OutputWriter out) {
            int n = in.nextInt();

            int[] a = in.nextIntArray(n);

            long sum = 0;

            int cnt = 0;
            int mini = Integer.MAX_VALUE;
            for (int i : a) {
                if (i < 0) cnt++;
                sum += Math.abs(i);
                mini = Math.min(mini, Math.abs(i));
            }

            if (cnt % 2 == 0) {
                out.println(sum);
            } else {
                out.println(sum - 2 * mini);
            }

        }

    }

    static class OutputWriter {
        private final PrintWriter writer;

        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }

        public OutputWriter(Writer writer) {
            this.writer = new PrintWriter(writer);
        }

        public void close() {
            writer.close();
        }

        public void println(long i) {
            writer.println(i);
        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private InputReader.SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public int[] nextIntArray(int n) {
            int[] array = new int[n];
            for (int i = 0; i < n; ++i) array[i] = nextInt();
            return array;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Ribhav
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastReader in = new FastReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        DFlippingSigns solver = new DFlippingSigns();
        solver.solve(1, in, out);
        out.close();
    }

    static class DFlippingSigns {
        public void solve(int testNumber, FastReader s, PrintWriter out) {
            int n = s.nextInt();
            long[] arr = s.nextLongArray(n);
            int count = 0;
            long min = Long.MAX_VALUE;
            long sum = 0;
            for (int i = 0; i < n; i++) {
                min = Math.min(Math.abs(arr[i]), min);
                sum += Math.abs(arr[i]);
                if (arr[i] < 0) {
                    count++;
                }
            }

            if (count % 2 == 0) {
                out.println(sum);
            } else {
                out.println(sum - 2 * min);
            }

        }

    }

    static class FastReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private FastReader.SpaceCharFilter filter;

        public FastReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public long nextLong() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public long[] nextLongArray(int n) {
            long[] array = new long[n];
            for (int i = 0; i < n; ++i) array[i] = nextLong();
            return array;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }
}


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

public class Main {
    static long INF = 1000000000;

    public static void main(String[] args) {
        FastScanner sc = new FastScanner();
        int n = sc.nextInt();
        long[] a = new long[n];
        long min = INF;
        long cntMinus = 0;
        long ans = 0;
        for (int i = 0; i < n; i++) {
            a[i] = sc.nextLong();
            if (a[i] < 0) {
                cntMinus++;
            }
            ans += Math.abs(a[i]);
            min = Math.min(min, Math.abs(a[i]));
        }
        if (cntMinus % 2 == 0) {
            System.out.println(ans);
            return;
        }
        System.out.println(ans - Math.abs(min) * 2);
    }
}

class FastScanner {
    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;

    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        } else {
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }

    private int readByte() {
        if (hasNextByte())
            return buffer[ptr++];
        else
            return -1;
    }

    private static boolean isPrintableChar(int c) {
        return 33 <= c && c <= 126;
    }

    public boolean hasNext() {
        while (hasNextByte() && !isPrintableChar(buffer[ptr]))
            ptr++;
        return hasNextByte();
    }

    public String next() {
        if (!hasNext())
            throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while (isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }

    public long nextLong() {
        if (!hasNext())
            throw new NoSuchElementException();
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while (true) {
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            } else if (b == -1 || !isPrintableChar(b)) {
                return minus ? -n : n;
            } else {
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }

    public int nextInt() {
        long nl = nextLong();
        if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE)
            throw new NumberFormatException();
        return (int) nl;
    }

    public double nextDouble() {
        return Double.parseDouble(next());
    }
}


import java.util.*;

/**
 * Main
 */
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int N = sc.nextInt();
		long ans = 0L;
		long min = 100000000000L;
		int count = 0;

		for (int i = 0; i < N; i++) {
			long X = sc.nextLong();
			if (X < 0) {
				count++;
			}
			min = Math.min(min, X);
			ans += Math.abs(X);
		}
		if (count % 2 == 0) {
			System.out.println(ans);
		} else {
			System.out.println(ans-2*min);
		}

		sc.close();
	}
};


import java.util.Arrays;
import java.util.Scanner;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int cnt = 0;
    long [] A = new long[N];
    long sum = 0;
    for(int i = 0; i < N; i++) {
    	A[i] = sc.nextLong();
    	if(A[i] < 0) cnt++;
    	sum += Math.abs(A[i]);
    }
    long ans = 0;
    if(cnt % 2 == 0) ans = sum;
    else {
    	Arrays.sort(A);
    	sum -= A[0];
    	ans = sum;
    }
    System.out.println(ans);
  }
}


import java.io.IOException;
import java.io.InputStream;
import java.util.InputMismatchException;

public class ABC125_d {

	public static void main(String[] args) {
		Task task = new Task();
		task.solve();
	}

	public static class Task {
		static final long MOD = (long) 1e9 + 7;

		public void solve() {
			Scan sc = new Scan();
			int n = (int) sc.scanLong();
			int minus = 0;
			int min = Integer.MAX_VALUE;
			long sum = 0;
			for (int i = 0; i < n; ++i) {
				int val = (int) sc.scanLong();
				if (val < 0)
					++minus;
				sum += Math.abs(val);
				min = Math.min(min, Math.abs(val));
			}
			if (minus % 2 == 0)
				System.out.println(sum);
			else
				System.out.println(sum - (min<<1));
		}
	}

	public static class Scan {
		private byte[] buf = new byte[1024];
		private int index;
		private InputStream in;
		private int total;

		public Scan() {
			in = System.in;
		}

		public int scan() {
			if (total < 0)
				throw new InputMismatchException();
			if (index >= total) {
				index = 0;
				try {
					total = in.read(buf);
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
				if (total <= 0)
					return -1;
			}
			return buf[index++];
		}

		public long scanLong() {
			long integer = 0;
			int n = scan();
			while (isWhiteSpace(n))
				n = scan();
			int neg = 1;
			if (n == '-') {
				neg = -1;
				n = scan();
			}
			while (!isWhiteSpace(n)) {
				if (n >= '0' && n <= '9') {
					integer *= 10;
					integer += n - '0';
					n = scan();
				} else
					throw new InputMismatchException();
			}
			return neg * integer;
		}

		public double scanDouble() throws IOException {
			double doub = 0;
			int n = scan();
			while (isWhiteSpace(n))
				n = scan();
			int neg = 1;
			if (n == '-') {
				neg = -1;
				n = scan();
			}
			while (!isWhiteSpace(n) && n != '.') {
				if (n >= '0' && n <= '9') {
					doub *= 10;
					doub += n - '0';
					n = scan();
				} else
					throw new InputMismatchException();
			}
			if (n == '.') {
				n = scan();
				double temp = 1;
				while (!isWhiteSpace(n)) {
					if (n >= '0' && n <= '9') {
						temp /= 10;
						doub += (n - '0') * temp;
						n = scan();
					} else
						throw new InputMismatchException();
				}
			}
			return doub * neg;
		}

		public String scanString() {
			StringBuilder sb = new StringBuilder();
			int n = scan();
			while (isWhiteSpace(n))
				n = scan();
			while (!isWhiteSpace(n)) {
				sb.append((char) n);
				n = scan();
			}
			return sb.toString();
		}

		public char scanChar() {
			int n = scan();
			while (isWhiteSpace(n))
				n = scan();
			return (char) n;
		}

		private boolean isWhiteSpace(int n) {
			if (n == ' ' || n == '\n' || n == '\r' || n == '\t' || n == -1)
				return true;
			return false;
		}
	}
}


#pragma GCC optimize ("O3")
#pragma GCC target ("avx")
//#include<bits/stdc++.h>
#include<cstdio>
#include<algorithm>
#include<vector>
#include<cmath>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define Would
#define you
#define please

const int cm = 1 << 17;
char cn[cm], * ci = cn, ct;
inline char getcha() {
	if (ci - cn == cm) { fread(cn, 1, cm, stdin); ci = cn; }
	return *ci++;
}

int main() {
	fread(cn, 1, cm, stdin);
	int N = 0;
	while ((ct = *ci++) >= '0') N = N * 10 + ct - '0';

	int fu = 0;
	int saishou = 1e9;
	ll goukei = 0;
	rep(i, N) {
		if (ci - cn + 16 > cm) {
			if ((ct = getcha()) == '-') { fu ^= 1; ct = getcha(); }
			int A = ct - '0';
			while ((ct = getcha()) >= '0') A = A * 10 + ct - '0';
			goukei += A;
			chmin(saishou, A);
		}
		else {
			if ((ct = *ci++) == '-') { fu ^= 1; ct = *ci++; }
			int A = ct - '0';
			while ((ct = *ci++) >= '0') A = A * 10 + ct - '0';
			goukei += A;
			chmin(saishou, A);
		}
	}

	if (fu) goukei -= saishou * 2;

	printf("%lld", goukei);

	Would you please return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define Would
#define you
#define please

const int cm = 1 << 17;
char cn[cm], *ci = cn + cm, ct;
inline char getcha() {
	if (ci - cn == cm) { fread(cn, 1, cm, stdin); ci = cn; }
	return *ci++;
}

int main() {
	fread(cn, 1, cm, stdin);
	ci = cn;
	int N = 0;
	int fu = 0;
	int saishou = 1e9;
	ll goukei = 0;
	while ((ct = *ci++) >= '0') N = N * 10 + ct - '0';

	rep(i, N) {
		if (ci - cn + 16 > cm) {
			ct = getcha();
			if (ct == '-') { fu ^= 1; ct = getcha(); }
			int A = ct - '0';
			while ((ct = getcha()) >= '0') A = A * 10 + ct - '0';
			goukei += A;
			saishou = min(saishou, A);
		}
		else {
			ct = *ci++;
			if (ct == '-') { fu ^= 1; ct = *ci++; }
			int A = ct - '0';
			while ((ct = *ci++) >= '0') A = A * 10 + ct - '0';
			goukei += A;
			saishou = min(saishou, A);
		}
	}

	if (fu & 1) goukei -= saishou * 2;

	co(goukei);

	Would you please return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define Would
#define you
#define please

int fu = 0;
int saishou = 1e9;
ll goukei = 0;

const int cm = 1 << 17;
char cn[cm], *ci = cn + cm, ct;
inline char getcha() {
	if (ci - cn == cm) { fread(cn, 1, cm, stdin); ci = cn; }
	return *ci++;
}
inline void getA() {
	char C = getcha();
	int pn = 1;
	if (C == '-') { fu ^= 1; C = getcha(); }
	int A = C - '0';
	while ((C = getcha()) >= '0') A = A * 10 + C - '0';
	goukei += A;
	saishou = min(saishou, A);
}

int main() {
	fread(cn, 1, cm, stdin);
	ci = cn;
	int N = 0;
	while ((ct = *ci++) >= '0') N = N * 10 + ct - '0';

	rep(i, N) getA();

	if (fu & 1) goukei -= saishou * 2;

	co(goukei);

	Would you please return 0;
}


#include <bits/stdc++.h>
//#include "atcoder/all"
using namespace std;
typedef long long ll;
int dx[] = {1, 0, -1, 0}, dy[] = {0, 1, 0, -1};
using pii = pair<int, int>;
const ll mod = 1e9 + 7;
int main() {
  int n;
  cin >> n;
  vector<ll> a(n);
  for (auto&& c : a) {
    cin >> c;
    c = abs(c);
  }

  /*   for (int i = 0; i < n - 1; i++) {
      if (a[i] >= 0 && a[i + 1] >= 0) {
        continue;
      } else if (a[i] < 0 && a[i + 1] < 0) {
        a[i] *= -1;
        a[i + 1] *= -1;
      } else {
        if (a[i] < 0) {
          if (abs(a[i]) > abs(a[i + 1])) {
            a[i] *= -1;
            a[i + 1] *= -1;
          }
        } else {
          if (abs(a[i]) < abs(a[i + 1])) {
            a[i] *= -1;
            a[i + 1] *= -1;
          }
        }
      }
    } */

  cout << accumulate(a.begin(), a.end(), 0LL) << endl;
}


#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;
using ll = long long;
using ull = unsigned long long;
using P = pair<int, int>;

int main() {
    int N;
    cin >> N;
    vector<ll> A(N);
    ll sum = 0;
    rep(i, N) cin >> A[i];
    for(int i = 0; i < N - 1; i++) {

        // A[i]*A[i+1]>0
        if(A[i] < 0 and A[i + 1] < 0) {
            A[i] *= -1;
            A[i + 1] *= -1;
        } else if(A[i] > 0 and A[i + 1] > 0) {

        }
        // A[i]*A[i+1]==0
        else if(A[i] * A[i + 1] == 0) {
            A[i] = abs(A[i]);
            A[i + 1] = abs(A[i + 1]);
        }
        // A[i]*A[i+1]<0
        else if(i == N - 2) {
            if(A[i] > A[i + 1] and abs(A[i]) < abs(A[i + 1])) {
                A[i] *= -1;
                A[i + 1] *= -1;
            } else if(A[i] < A[i + 1] and abs(A[i]) > abs(A[i + 1])) {
                A[i] *= -1;
                A[i + 1] *= -1;
            }
        } else {
            if(A[i] < 0) {
                A[i] *= -1;
                A[i + 1] *= -1;
            }
        }

        if(i == N - 2) {
            sum = sum + A[i] + A[i + 1];
        } else {
            sum += A[i];
        }
    }

    cout << sum << endl;
    return 0;
}


#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;
using ll = long long;
using ull = unsigned long long;
using P = pair<int, int>;
const int MAX = 1234567;
const int MOD = 1000000007;

long long fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for(int i = 2; i < MAX; i++) {
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

// 二項係数計算
long long COM(int n, int k) {
    if(n < k)
        return 0;
    if(n < 0 || k < 0)
        return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

int main() {
    int X, Y;
    cin >> X >> Y;
    int s, t;

    if((2 * Y - X) < 0 or (2 * X - Y) < 0 or (2 * Y - X) % 3 != 0 or
       (2 * X - Y) % 3 != 0) {
        cout << 0 << endl;
        return 0;
    } else {
        s = (2 * Y - X) / 3;
        t = (2 * X - Y) / 3;
    }
    // 前処理
    COMinit();
    // 計算
    cout << COM(s + t, s) % MOD << endl;
    return 0;
}


// AtCoder ABC125: D - Flipping Signs
// 2019.9.9 bal4u

#include <stdio.h>

typedef long long ll;

#if 1
int getchar_unlocked(void);
#define gc() getchar_unlocked()
#else
#define gc() getchar()
#endif

int in() {  // 整数の入力
	int n = 0, c = gc();
	if (c == '-') {	c = gc();
		do n = 10*n + (c & 0xf), c = gc(); while (c >= '0');
		return -n;
	}
	do n = 10*n + (c & 0xf), c = gc(); while (c >= '0');
	return n;
}

#define INF 0x7fffffff

int main()
{
	int i, minus, mi, A, N; ll ans;

	N = in();
	minus = 0, ans = 0, mi = INF;
	for (i = 0; i < N; i++) {
		A = in();
		if (A < 0) minus++, A = -A;
		if (A < mi) mi = A;
		ans += A;
	}
	if (minus & 1) ans -= 2*mi;
	printf("%lld\n", ans);
	return 0;
}


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

int main(void){
  int N,i;
  long a[100005],sum,count,zero,min;
  char str[2000005],*p;

  fgets(str,sizeof(str),stdin);
  N=atoi(str);

  fgets(str,sizeof(str),stdin);
  p=strtok(str," \n");
  a[0]=atol(p);
  for(i=1;i<N;i++){
    p=strtok(NULL," \n");
    a[i]=atol(p);
  }

  for(i=0,count=0,zero=0;i<N;i++){
    if(a[i]<0){
      count++;
    }
    if(a[i]==0){
      zero++;
    }
  }
  for(i=0;i<N;i++){
      sum+=labs(a[i]);
    }

  if(zero!=0 || count%2==0){
    printf("%ld\n",sum);
    return 0;
  }

  if(count%2==1){
    for(i=0,min=labs(a[0]);i<N;i++){
      if(labs(a[i])<min){
        min=labs(a[i]);
      }
    }
    printf("%ld\n",sum-2*labs(min));
    return 0;

  }

}


typedef long unsigned int size_t;
extern int printf (const char *__restrict __format, ...);
extern int scanf (const char *__restrict __format, ...) ;
extern int getchar (void);
extern int putchar (int __c);
int nextInt(){int f=0;char s=0;char c=getchar();while((c<48)||(57<c)){if(c==45){s=1;c=getchar();break;}c=getchar();}while((48<=c)&&(c<=57)){f=f*10+(c-48);c=getchar();}return s?-f:f;}
char nextChar(){char f=0;char s=0;char c=getchar();while((c<48)||(57<c)){if(c==45){s=1;c=getchar();break;}c=getchar();}while((48<=c)&&(c<=57)){f=f*10+(c-48);c=getchar();}return s?-f:f;}
short nextShort(){short f=0;char s=0;char c=getchar();while((c<48)||(57<c)){if(c==45){s=1;c=getchar();break;}c=getchar();}while((48<=c)&&(c<=57)){f=f*10+(c-48);c=getchar();}return s?-f:f;}
long nextLong(){long f=0;char s=0;char c=getchar();while((c<48)||(57<c)){if(c==45){s=1;c=getchar();break;}c=getchar();}while((48<=c)&&(c<=57)){f=f*10+(c-48);c=getchar();}return s?-f:f;}
void println(){putchar(10);}
void print(char *f){while(*f){putchar(*f);f++;}}
void printInt(int f){if(f==0x80000000){print("-2147483648");return;}char c[11];if(!f){putchar(48);return;}if(f<0){f=-f;putchar(45);}char i=0;while(f){c[++i]=(f%10)+48;f/=10;}while(i){putchar(c[i--]);}}
void printLong(long f){if(f==0x8000000000000000){print("-9223372036854775808");return;}char c[20];if(!f){putchar(48);return;}if(f<0){f=-f;putchar(45);}char i=0;while(f){c[++i]=(f%10)+48;f/=10;}while(i){putchar(c[i--]);}}
int min2(int a, int b){return a>b?b:a;}
int n, g, i;
int a, min;
long sum;
int main(void){
 n=nextInt();
 min=0x0FFFFFFF;
 for(i=0; i<n; i++){
  a=nextInt();
  if(a<0){
   sum -= a;
   g++;
   min = min2(min, -a);
  }else{
   sum += a;
   min = min2(min, a);
  }
 }
 if(g&1){
  printLong(sum-2*min);
 }else{
  printLong(sum);
 }
 println();
}


#include <stdio.h>
#include <stdbool.h>
long long arr[100010];

int main()
{
	int n;
	scanf("%d", &n);
	bool odd = false;
	bool zero = false;
	int max = 0;
	int min = 0;
	long long res = 0;
	for(int i=1; i<n+1; ++i)
	{
		scanf("%lld", arr + i);
		if(arr[i] == 0)
		{
			zero = true;
		}
		else if(arr[i] < 0)
		{
			odd = !odd;
			if(max == 0 || arr[max] < arr[i])
				max = i;
		}
		else if(arr[i] > 0)
		{
			if(min == 0 || arr[min] > arr[i])
				min = i;
		}
		res += arr[i] < 0 ? -arr[i] : arr[i];
	}
	if(!zero && odd)
	{
		if(max > 0 && min > 0)
		{
			if( -arr[max] > arr[min])
			{
				arr[max] = -arr[max];
				res -= arr[min] + arr[max];
				arr[min] = -arr[min];
				res += arr[min] + arr[max] ;
			}
		}
		else if(min < 1)
		{
			arr[max] = -arr[max];
			res -= arr[max] + arr[max];
		}
	}

	printf("%lld\n", res);
	return 0;
}


#include <stdio.h>
#include <stdbool.h>
long long arr[100010];

int main()
{
	int n;
	scanf("%d", &n);
	bool odd = false;
	bool zero = false;
	int max1 = -1;
	int max2 = -1;
	int min1 = -1;
	int min2 = -1;
	long long res = 0;
	for(int i=0; i<n; ++i)
	{
		scanf("%lld", arr + i);
		if(arr[i] == 0)
			zero = true;
		if(arr[i] < 0)
		{
			odd = !odd;
			if(max1 < 0)
				max1 = i;
			else
			{
				if(arr[max1] < arr[i])
				{
					max2 = max1;
					max1 = i;
				}
			}
		}
		if(arr[i] > 0)
		{
			if(min1 < 0)
				min1 = i;
			else
			{
				if(arr[min1] > arr[i])
				{
					min2= min1;
					min1 = i;
				}
			}
		}
		res += arr[i] < 0 ? -arr[i] : arr[i];
	}
	if(!zero && odd)
	{
		if(max1 >= 0 && min1 >= 0)
		{
			if( -arr[max1] > arr[min1])
			{
				arr[max1] = -arr[max1];
				res -= arr[min1] + arr[max1];
				arr[min1] = -arr[min1];
				res += arr[min1] + arr[max1] ;
			}
		}
		else if(min1 < 0)
		{
			arr[max1] = -arr[max1];
			res -= arr[max1] + arr[max1];
		}
	}

	printf("%lld\n", res);
	return 0;
}


#include <stdio.h>
long long arr[100010];

int main()
{
	int n;
	scanf("%d", &n);
	int flag = 0;
	int nozero = 1;
	int max = 0;
	int min = 0;
	for(int i=1; i<n+1; ++i)
	{
		scanf("%lld", arr + i);
		if(arr[i] < 0)
		{
			flag = !flag;
			if(max == 0)
				max = i;
			if(arr[max] < arr[i])
				max = i;
		}
		else
		{
			if(min == 0)
				min = i;
			if(arr[min] > arr[i])
				min = i;
		}

		if(arr[i] == 0)
			nozero = 0;
	}
	if(flag && nozero)
	{
		if(-arr[max] > arr[min])
		{
			arr[max] = -arr[max];
			arr[min] = -arr[min];
		}
	}

	long long res = 0;
	for(int i=1; i<n+1; ++i)
	{
		if(i != min && i != max && arr[i] < 0)
			arr[i] = -arr[i];
		if(nozero == 0 && arr[i] < 0)
			arr[i] = -arr[i];

 		res += arr[i];

	}

	printf("%lld\n", res);
	return 0;
}


function Main(input) {
  lines = input.split("\n")
  n = lines[0] * 1
  a = lines[1].split(' ').map(Number)
  ans = 0
  min = Math.abs(a[a.length-1])
  flgs = 0
  for (i=0; i<a.length;i++) {
    if (a[i] < 0) flgs++
    min = Math.min(Math.abs(a[i]), min)
    ans += a[i] >= 0 ? a[i] : a[i] * -1
  }
  if (flgs % 2 == 0) {
    console.log(ans);
  } else {
    console.log(ans-min*2);
  }
}

//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


var input = require("fs").readFileSync("/dev/stdin", "utf8").trim().split("\n");
var obj = {
  "list" : input,
  "index" : 0,
  "max" : input.length,
  "next" : function(){
    if(!this.hasNext()){throw "NoSuchElementException:次に要素は無いよ";}
    var returnObj = this.list[this.index];
    this.index++;
    return returnObj;
  },
  "hasNext" : function(){return (this.index < this.max);}
}
Main();
function next(){return obj.next();}
function hasNext(){return obj.hasNext();}
function myout(t){console.log(t);}//standard output
function myerr(t){console.error(t);}//standard error
//[no]要素の扱い。数値型
//不明値、異常時:引数そのまま返す
//1:数値へ変換 2:半角SPで分割 4:半角SPで分割し、数値配列へ
//6:1文字に分割 7:1文字に分割し、数値配列へ
//8:半角SPで結合 9:改行で結合 0:文字なしで結合
function myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(" ");case 4:return i.split(" ").map((a)=>Number(a));case 6:return i.split("");case 7:return i.split("").map((a)=>Number(a));case 8:return i.join(" ");case 9:return i.join("\n");case 0:return i.join("");default:return i;}}catch(e){return i;}}
function Main(){
  var N = myconv(next(),1);
  var list = myconv(next(),4);
  //0がある、またはマイナスの個数が偶数個なら、マイナス全消しできる。
  //そうでないなら、要素中、絶対値が一番小さいやつにマイナスがつき、他はプラス
  if(list.indexOf(0) != -1){
     var output = 0;
     for(var i = 0; i < N; i++){
       output += Math.abs(list[i]);
     }
     myout(output);
  }else{
    var min = 1000000007;
    var minIndex = 0;
    var minusCount = 0;
    var output = 0;
    for(var i = 0; i < N; i++){
      output += Math.abs(list[i]);
      if(list[i] < 0){
         minusCount++;
      }
      if(min > Math.abs(list[i])){
         min = Math.abs(list[i]);
        minIndex = i;
      }
    }
    if(minusCount % 2 == 1){
       output -= (min * 2);
    }
    myout(output);
  }
}


module.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){n(1)(n(2).readFileSync("/dev/stdin","UTF-8").split("\n"))},function(e,t){e.exports=function(e){for(var t=Number(e[0]),n=e[1].split(" ").map(function(e){return Number(e)}),r=0,o=1e10,u=0,i=0;i<t;i++)n[i]<0&&r++,Math.abs(n[i])<o&&(o=Math.abs(n[i])),u+=Math.abs(n[i]);r%2==0?console.log(u):console.log(u-2*o)}},function(e,t){e.exports=require("fs")}]);


"use strict"

function Main(input) {
  input = input.split('\n');
  let N = parseInt(input.shift());
  let array = input.shift().split(/\s/).map(value => value - 0);
  let result = 0;
  let min = Math.abs(array[0]);
  let count = 0;
  for(let i=0;i<N;i++){
    let tmp = array[i];
    if(tmp > 0){
      result += tmp;
      min = Math.min(tmp, min);
    } else {
      result -= tmp;
      min = Math.min(-tmp, min);
      count++;
    }
  }
  if(count % 2 == 1) {
    result -= min;
  }
  console.log(result);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


function Main(input) {
  input = input.split("\n");
  var n = parseInt(input[0], 10);
  var a = input[1].split(" ");
  var tmp = Math.abs(a[0]);
  var tmp2 = 0;

  for (var i = 0; i < n; i++) {
    tmp2 += Math.abs(a[i]);
    if (tmp > Math.abs(a[i])) {
      tmp = Math.abs(a[i]);
    }
  }
  console.log('%d',tmp2 - 2 * tmp);
}

//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


function Main(input) {
  input = input.split("\n");
  var n = parseInt(input[0], 10);
  var a = input[1].split(" ");
  var tmp = a[0];
  var tmp2 = 0;
  var count = 0;
  var flg = false;

  for (var i = 0; i < n; i++) {
    if (a[i] < 0) {
      count++;
    }
    if (a[i] == 0) {
      flg = true;
    }
    tmp2 += Math.abs(a[i]);
    if (tmp > Math.abs(a[i])) {
      tmp = Math.abs(a[i]);
    }
  }
  if (count % 2 == 0 || flg) {
    console.log('%d',tmp2);
  } else {
    console.log('%d',tmp2 - tmp * 2);
  }
}

//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


package main

import (
	"bufio"
	"fmt"
	"os"
)

var sc = bufio.NewScanner(os.Stdin)

func ri() (n int) {
	sc.Scan()
	b := sc.Bytes()
	if b[0] == 45 {
		return -b2i(b[1:])
	} else {
		return b2i(b)
	}
}

func b2i(a []byte) (n int) {
	for _, v := range a {
		n = n*10 + int(v-48)
	}
	return
}

func main() {
	sc.Split(bufio.ScanWords)
	n := ri()

	sum := 0
	minAbs := int(1e10)
	ctOdd := 0
	for i := 0; i < n; i++ {
		x := ri()
		if x < 0 {
			ctOdd++
			x *= -1
		}
		sum += x
		if x < minAbs {
			minAbs = x
		}
	}

	if ctOdd%2 == 0 {
		fmt.Println(sum)
	} else {
		fmt.Println(sum - minAbs*2)
	}
}


package main

import (
	"bufio"
	"fmt"
	"os"
)

var sc = bufio.NewScanner(os.Stdin)

func ri() (n int) {
	sc.Scan()
	b := sc.Bytes()
	if b[0] == 45 {
		return -b2i(b[1:])
	} else {
		return b2i(b)
	}
}

func abs(x int) int {
	if x < 0 {
		return -x
	}
	return x
}

func b2i(a []byte) (n int) {
	for _, v := range a {
		n = n*10 + int(v-48)
	}
	return
}

func sum(a []int) (x int) {
	for _, i := range a {
		x += i
	}
	return
}

func main() {
	sc.Split(bufio.ScanWords)
	n := ri()

	a := make([]int, n)
	minAbs := int(1e10)
	for i := 0; i < n; i++ {
		a[i] = ri()

		if x := abs(a[i]); x < minAbs {
			minAbs = x
		}
	}

	for i := 0; i <= n-2; i++ {
		if a[i] < 0 {
			a[i] *= -1
			a[i+1] *= -1
		}
	}

	if a[n-1] < 0 {
		fmt.Println(sum(a) + abs(a[n-1])*2 - minAbs*2)
	} else {
		fmt.Println(sum(a))
	}
}


package main

import (
	"bufio"
	"bytes"
	"fmt"
	"io"
	"os"
	"strconv"
)

// -----------------------------------------------------------------------------

// IO helper functions

// Returns next token from input.  It must be initialized by SetInput()
// before the first call.
var nextToken func() ([]byte, error)
var nextLine func() ([]byte, error)

// Holds a buffer for output.  It must be initialized by SetOutput().
// All IO fucntions (read*() and [e]print*()) should write to OutputWriter
// instead of this.
var OutputBuffer *bufio.Writer

// Holds an io.Writer.  It must be initialized by SetOutput()
var OutputWriter io.Writer

// Set IO functions for interactive input/output.
func SetInteractive(w io.Writer, r io.Reader) {
	SetUnbefferedInput(r)
	OutputBuffer = nil
	OutputWriter = w
}

// Setup OutputBuffer and OutputWriter.
func SetOutput(w io.Writer) {
	OutputBuffer = bufio.NewWriter(w)
	OutputWriter = OutputBuffer
}

// Flushes OutputBuffer
func Flush() {
	if OutputBuffer != nil {
		OutputBuffer.Flush()
	}
}

// Returns true if c is a white space
func IsSpace(c byte) bool {
	switch c {
	case '\t', '\n', '\v', '\f', '\r', ' ':
		return true
	}
	return false
}

func IsNewLine(c byte) bool {
	switch c {
	case '\n', '\r':
		return true
	}
	return false
}

// Setup nextToken with input buffer.
func SetInput(r io.Reader) {
	buf := new(bytes.Buffer)
	var b []byte

	var i int
	rest := func() ([]byte, error) {
		for i < len(b) && IsSpace(b[i]) {
			i++
		}
		if i == len(b) {
			return nil, io.ErrUnexpectedEOF
		}
		j := i
		for i < len(b) && !IsSpace(b[i]) {
			i++
		}
		return b[j:i], nil
	}
	initial := func() ([]byte, error) {
		io.Copy(buf, r)
		b = buf.Bytes()
		nextToken = rest
		return rest()
	}
	nextToken = initial

	restLn := func() ([]byte, error) {
		for i < len(b) && IsNewLine(b[i]) {
			i++
		}
		if i == len(b) {
			return nil, io.ErrUnexpectedEOF
		}
		j := i
		for i < len(b) && !IsNewLine(b[i]) {
			i++
		}
		return b[j:i], nil
	}

	initialLn := func() ([]byte, error) {
		io.Copy(buf, r)
		b = buf.Bytes()
		nextLine = restLn
		return restLn()
	}
	nextLine = initialLn
}

// Setup nextToken without input buffer.
func SetUnbefferedInput(r io.Reader) {
	buf := bufio.NewReader(r)
	var b []byte

	var i int
	nextToken = func() ([]byte, error) {
		var err error
		if i == len(b) {
			b, err = buf.ReadBytes('\n')
			if err != nil {
				return nil, err
			}
			i = 0
			j := len(b) - 1
			for 0 <= j && IsSpace(b[j]) {
				j--
			}
			b = b[0 : j+1]
		}
		for i < len(b) && IsSpace(b[i]) {
			i++
		}
		j := i
		for i < len(b) && !IsSpace(b[i]) {
			i++
		}
		if i == j {
			return nil, io.ErrUnexpectedEOF
		}
		return b[j:i], nil
	}
}

// -----------------------------------------------------------------------------

// IO functions

// Reads next token and return it as []byte
func readb() []byte {
	b, err := nextToken()
	if err != nil {
		panic(err)
	}
	return b
}

// Reads next token and return it as string
func reads() string {
	return string(readb())
}

// Read next line as []byte
func readbln() []byte {
	b, err := nextLine()
	if err != nil {
		panic(err)
	}
	return b
}

// Read next line as string
func readsln() string {
	return string(readbln())
}

// Reads next token and return it as int64
func readll() int64 {
	i, err := strconv.ParseInt(reads(), 10, 64)
	if err != nil {
		panic(err.Error())
	}
	return i
}

// Reads next token and return it as int
func readi() int {
	return int(readll())
}

// Reads next token and return it as float64
func readf() float64 {
	f, err := strconv.ParseFloat(reads(), 64)
	if err != nil {
		panic(err.Error())
	}
	return f
}

// Write args to OutputWriter with the format f
func printf(f string, args ...interface{}) (int, error) {
	return fmt.Fprintf(OutputWriter, f, args...)
}

// Write args to OutputWriter without format
func println(args ...interface{}) (int, error) {
	return fmt.Fprintln(OutputWriter, args...)
}

// Write args to stderr with the format f
func eprintf(f string, args ...interface{}) (int, error) {
	return fmt.Fprintf(os.Stderr, f, args...)
}

// Write args to stderr without format
func eprintln(args ...interface{}) (int, error) {
	return fmt.Fprintln(os.Stderr, args...)
}

// -----------------------------------------------------------------------------

// Simple math functions

const (
	// big prime
	INF  = 1000000007
	INF2 = 1000000009
	INF3 = 998244353
)

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func max(a, b int) int {
	if a < b {
		return b
	}
	return a
}

func abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}

func gcd(a, b int) int {
	if b == 0 {
		return a
	}
	return gcd(b, a%b)
}

// set up IO functions
func init() {
	// for non-interactive
	SetInput(os.Stdin)
	SetOutput(os.Stdout)

	// Enable below when interactive.  Its ok to leave above intact.
	// SetInteractive(os.Stdout, os.Stdin)
}

func main() {
	defer Flush()

	N := readi()
	A := make([]int, N)
	for i := range A {
		A[i] = readi()
	}

	var ans, minus int
	minv := INF
	for _, v := range A {
		if v < 0 {
			minus++
		}
		minv = min(minv, abs(v))
		ans += abs(v)
	}
	if minus%2 == 1 {
		ans -= 2 * minv
	}
	println(ans)
}


// 偶数なら全部変えられるし奇数ならabs(x)の最小に-を押し付けることができそう
package main

import "fmt"

func main() {
	var N int
	fmt.Scan(&N)
	sum := 0
	minn := int(1e10)
	minc := 0
	for i := 0; i < N; i++ {
		var A int
		fmt.Scan(&A)
		if A < 0 {
			minc++
			if minn > abs(A) {
				minn = abs(A)
			}
		}
		sum += abs(A)
	}
	if minc%2 == 0 {
		fmt.Println(sum)
	} else {
		fmt.Println(sum - 2*minn)
	}
}
func abs(x int) int {
	if x < 0 {
		x *= -1
	}
	return x
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func max(a, b int) int {
	if a < b {
		return b
	}
	return a
}


// 問題文読んでないけど負数が奇数の場合は両端どっちかで偶数の場合はなんとなく全部正にできそう
// """0""" の存在を忘れていた...
// 意味不明なことにWA
// アホだった なーにが「両端どっちか」じゃボケが 最小値にすることが可能
package main

import "fmt"

func main() {
	var N int
	fmt.Scan(&N)
	A := make([]int, N)
	S := 0
	minus := 0
	zero := false
	minn := int(1e10)
	for i := 0; i < N; i++ {
		var V int
		fmt.Scan(&V)
		if V == 0 {
			zero = true
		} else {
			minn = min(minn, abs(V))
		}
		A[i] = abs(V)
		S += abs(V)
		if V < 0 {
			minus++
		}
	}
	fmt.Println(minn)
	if zero {
		fmt.Println(S)
	} else if minus%2 == 0 {
		fmt.Println(S)
	} else {
		fmt.Println(S - minn*2)
	}
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func abs(x int) int {
	if x < 0 {
		x *= -1
	}
	return x
}


// 問題文読んでないけど負数が奇数の場合は両端どっちかで偶数の場合はなんとなく全部正にできそう
// """0""" の存在を忘れていた...
// 意味不明なことにWA
// アホだった なーにが「両端どっちか」じゃボケが 最小値にすることが可能
package main

import "fmt"

func main() {
	var N int
	fmt.Scan(&N)
	A := make([]int, N)
	S := 0
	minus := 0
	zero := false
	minn := 1
	for i := 0; i < N; i++ {
		var V int
		fmt.Scan(&V)
		if V == 0 {
			zero = true
		} else {
			minn = min(minn, abs(V))
		}
		A[i] = abs(V)
		S += abs(V)
		if V < 0 {
			minus++
		}
	}
	if zero {
		fmt.Println(S)
	} else if minus%2 == 0 {
		fmt.Println(S)
	} else {
		fmt.Println(S - minn*2)
	}
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func abs(x int) int {
	if x < 0 {
		x *= -1
	}
	return x
}


N = gets.chomp.to_i
A = gets.split

minus = 0

a = A[0].to_i
if a <= 0
  a *= (-1)
  minus += 1
end
minabs = a
sum = a

for x in 1...N
  a = A[x].to_i
  if a <= 1
    a *= (-1)
    minus += 1
  end
  if a < minabs
    minabs = a
  end
  sum += a
end

if minus % 2 == 1
  sum -= minabs * 2
end

puts sum


n = gets.to_s.to_i
a = gets.to_s.split

n_nega = 1
ans_sum = 0
abs_min = 1_000_000_000

a.each do |t|

  t = t.to_i

  ab = t.abs

  ans_sum += ab

  abs_min = ab if abs_min > ab

  n_nega *= -1 if t < 0
end

puts n_nega == 1 ? ans_sum : ans_sum - abs_min * 2


n = gets.chomp.to_i
a = gets.split.map(&:to_i)
min = 10**12
count = 0
sum = 0
n.times do |i|
  v = a[i]
  if v < 0
    count += 1
    v = -v
  end
  min = v if min > v
  sum += v
end
sum -= min * 2 if count.odd?
puts sum


N=gets.to_i
array=gets.chomp.split(" ").map(&:to_i).sort_by{|a| a.abs }

minus_count = 0
ret = 0
array.each do |a|
    minus_count+=1 if a < 0
    ret+=a.abs
end
ret-=(array[0]*2) if minus_count.odd?
puts ret


n = gets.to_i
a = gets.chomp.split.map(&:to_i)

i = 0
j = n - 1
res = 0
while j - i > 1
  if a[i] < 0 || a[j] < 0
    if a[i] >= 0
      a[j] = - a[j]
      j -= 1
      a[j] = - a[j]
    elsif a[j] >= 0
      a[i] = - a[i]
      i += 1
      a[i] = - a[i]
    else
      if a[i] + a[i + 1] <= 0
        a[i] = - a[i]
        i += 1
        a[i] = - a[i]
      elsif a[j - 1] + a[j] <= 0
        a[j] = - a[j]
        j -= 1
        a[j] = - a[j]
      else
        if a[j - 1] + a[j] >= a[i] + a[i + 1]
          j -= 1
        else
          i += 1
        end
      end
    end
  else
    if a[i] > 0
      i += 1
    else
      j -= 1
    end
  end
end

if a[i] + a[j] < 0
  a[i] = - a[i]
  a[j] = - a[j]
end
puts a.inject(:+)


eval'A=#'+`tr ' ' ,`
p -A.count{_1<0}%2*2*A.map!(&:abs).min+A.sum