import java.util.Scanner;
import java.util.List;
import java.util.ArrayList;
import java.util.Collections;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();
		Integer num[] = new Integer[105];
		for (int i = 0; i < N; i++) {
			num[i] =sc.nextInt();
		}
		int alice = 0;
		int bob = 0;

		List<Integer> li = new ArrayList<Integer>();
		for (int i = 0; i < N; i++) {
			li.add(num[i]);
		}

		Collections.sort(li);

		for (int i = N - 1; i >= 0; i--) {
			alice += li.get(i);
			if (--i < 0) {
				break;
			}
			bob += li.get(i);
		}

		System.out.println(alice - bob);
	}
} import java.util.Scanner; Scanner java.util import java.util.List; List java.util import java.util.ArrayList; ArrayList java.util import java.util.Collections; Collections java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();
		Integer num[] = new Integer[105];
		for (int i = 0; i < N; i++) {
			num[i] =sc.nextInt();
		}
		int alice = 0;
		int bob = 0;

		List<Integer> li = new ArrayList<Integer>();
		for (int i = 0; i < N; i++) {
			li.add(num[i]);
		}

		Collections.sort(li);

		for (int i = N - 1; i >= 0; i--) {
			alice += li.get(i);
			if (--i < 0) {
				break;
			}
			bob += li.get(i);
		}

		System.out.println(alice - bob);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();
		Integer num[] = new Integer[105];
		for (int i = 0; i < N; i++) {
			num[i] =sc.nextInt();
		}
		int alice = 0;
		int bob = 0;

		List<Integer> li = new ArrayList<Integer>();
		for (int i = 0; i < N; i++) {
			li.add(num[i]);
		}

		Collections.sort(li);

		for (int i = N - 1; i >= 0; i--) {
			alice += li.get(i);
			if (--i < 0) {
				break;
			}
			bob += li.get(i);
		}

		System.out.println(alice - bob);
	} main {
		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();
		Integer num[] = new Integer[105];
		for (int i = 0; i < N; i++) {
			num[i] =sc.nextInt();
		}
		int alice = 0;
		int bob = 0;

		List<Integer> li = new ArrayList<Integer>();
		for (int i = 0; i < N; i++) {
			li.add(num[i]);
		}

		Collections.sort(li);

		for (int i = N - 1; i >= 0; i--) {
			alice += li.get(i);
			if (--i < 0) {
				break;
			}
			bob += li.get(i);
		}

		System.out.println(alice - bob);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc Integer num[] = new Integer[105]; num new Integer[105] 105 for (int i = 0; i < N; i++) {
			num[i] =sc.nextInt();
		} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
			num[i] =sc.nextInt();
		} {
			num[i] =sc.nextInt();
		} num[i] =sc.nextInt() num[i] num i sc.nextInt() sc.nextInt sc int alice = 0; alice 0 int bob = 0; bob 0 List<Integer> li = new ArrayList<Integer>(); li new ArrayList<Integer>() for (int i = 0; i < N; i++) {
			li.add(num[i]);
		} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
			li.add(num[i]);
		} {
			li.add(num[i]);
		} li.add(num[i]) li.add li num[i] num i Collections.sort(li) Collections.sort Collections li for (int i = N - 1; i >= 0; i--) {
			alice += li.get(i);
			if (--i < 0) {
				break;
			}
			bob += li.get(i);
		} int i = N - 1; int i = N - 1; i N - 1 N 1 i >= 0 i 0 i-- i-- i {
			alice += li.get(i);
			if (--i < 0) {
				break;
			}
			bob += li.get(i);
		} {
			alice += li.get(i);
			if (--i < 0) {
				break;
			}
			bob += li.get(i);
		} alice += li.get(i) alice li.get(i) li.get li i if (--i < 0) {
				break;
			} --i < 0 --i i 0 {
				break;
			} break; bob += li.get(i) bob li.get(i) li.get li i System.out.println(alice - bob) System.out.println System.out System System.out alice - bob alice bob String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();
		Integer num[] = new Integer[105];
		for (int i = 0; i < N; i++) {
			num[i] =sc.nextInt();
		}
		int alice = 0;
		int bob = 0;

		List<Integer> li = new ArrayList<Integer>();
		for (int i = 0; i < N; i++) {
			li.add(num[i]);
		}

		Collections.sort(li);

		for (int i = N - 1; i >= 0; i--) {
			alice += li.get(i);
			if (--i < 0) {
				break;
			}
			bob += li.get(i);
		}

		System.out.println(alice - bob);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();
		Integer num[] = new Integer[105];
		for (int i = 0; i < N; i++) {
			num[i] =sc.nextInt();
		}
		int alice = 0;
		int bob = 0;

		List<Integer> li = new ArrayList<Integer>();
		for (int i = 0; i < N; i++) {
			li.add(num[i]);
		}

		Collections.sort(li);

		for (int i = N - 1; i >= 0; i--) {
			alice += li.get(i);
			if (--i < 0) {
				break;
			}
			bob += li.get(i);
		}

		System.out.println(alice - bob);
	}
} Main
import java.util.Scanner;
import java.util.List;
import java.util.ArrayList;
import java.util.Collections;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();
		Integer num[] = new Integer[105];
		for (int i = 0; i < N; i++) {
			num[i] =sc.nextInt();
		}
		int alice = 0;
		int bob = 0;

		List<Integer> li = new ArrayList<Integer>();
		for (int i = 0; i < N; i++) {
			li.add(num[i]);
		}

		Collections.sort(li);

		for (int i = N - 1; i >= 0; i--) {
			alice += li.get(i);
			if (--i < 0) {
				break;
			}
			bob += li.get(i);
		}

		System.out.println(alice - bob);
	}
}