import java.util.Scanner;
public class Main {
 
	public static void main(String[] args) {
		Scanner sn=new Scanner(System.in);
		int s=sn.nextInt();
		int[] card=new int[101];
		int alice=0;
        int bob=0;
		for(int i=0;i<s;i++) {
			card[i]=sn.nextInt();
		}
		int max=0,save=0;
		for(int i=0;i<s;i++) {
			for(int j=0;j<s;j++) {
				if(card[i]>card[j]) {
					save=card[j];
					card[j]=card[i];
					card[i]=save;
				}
			}
		}
		for(int i=0;i<s;i++) {
			if(i%2==0){
              alice+=card[i];
            }else{
              bob+=card[i];
            }
		}
		System.out.println(alice-bob);
	}
} import java.util.Scanner; Scanner java.util public class Main {
 
	public static void main(String[] args) {
		Scanner sn=new Scanner(System.in);
		int s=sn.nextInt();
		int[] card=new int[101];
		int alice=0;
        int bob=0;
		for(int i=0;i<s;i++) {
			card[i]=sn.nextInt();
		}
		int max=0,save=0;
		for(int i=0;i<s;i++) {
			for(int j=0;j<s;j++) {
				if(card[i]>card[j]) {
					save=card[j];
					card[j]=card[i];
					card[i]=save;
				}
			}
		}
		for(int i=0;i<s;i++) {
			if(i%2==0){
              alice+=card[i];
            }else{
              bob+=card[i];
            }
		}
		System.out.println(alice-bob);
	}
} Main public static void main(String[] args) {
		Scanner sn=new Scanner(System.in);
		int s=sn.nextInt();
		int[] card=new int[101];
		int alice=0;
        int bob=0;
		for(int i=0;i<s;i++) {
			card[i]=sn.nextInt();
		}
		int max=0,save=0;
		for(int i=0;i<s;i++) {
			for(int j=0;j<s;j++) {
				if(card[i]>card[j]) {
					save=card[j];
					card[j]=card[i];
					card[i]=save;
				}
			}
		}
		for(int i=0;i<s;i++) {
			if(i%2==0){
              alice+=card[i];
            }else{
              bob+=card[i];
            }
		}
		System.out.println(alice-bob);
	} main {
		Scanner sn=new Scanner(System.in);
		int s=sn.nextInt();
		int[] card=new int[101];
		int alice=0;
        int bob=0;
		for(int i=0;i<s;i++) {
			card[i]=sn.nextInt();
		}
		int max=0,save=0;
		for(int i=0;i<s;i++) {
			for(int j=0;j<s;j++) {
				if(card[i]>card[j]) {
					save=card[j];
					card[j]=card[i];
					card[i]=save;
				}
			}
		}
		for(int i=0;i<s;i++) {
			if(i%2==0){
              alice+=card[i];
            }else{
              bob+=card[i];
            }
		}
		System.out.println(alice-bob);
	} Scanner sn=new Scanner(System.in); sn new Scanner(System.in) int s=sn.nextInt(); s sn.nextInt() sn.nextInt sn int[] card=new int[101]; card new int[101] 101 int alice=0; alice 0 int bob=0; bob 0 for(int i=0;i<s;i++) {
			card[i]=sn.nextInt();
		} int i=0; int i=0; i 0 i<s i s i++ i++ i {
			card[i]=sn.nextInt();
		} {
			card[i]=sn.nextInt();
		} card[i]=sn.nextInt() card[i] card i sn.nextInt() sn.nextInt sn int max=0 max 0 save=0; save 0 for(int i=0;i<s;i++) {
			for(int j=0;j<s;j++) {
				if(card[i]>card[j]) {
					save=card[j];
					card[j]=card[i];
					card[i]=save;
				}
			}
		} int i=0; int i=0; i 0 i<s i s i++ i++ i {
			for(int j=0;j<s;j++) {
				if(card[i]>card[j]) {
					save=card[j];
					card[j]=card[i];
					card[i]=save;
				}
			}
		} {
			for(int j=0;j<s;j++) {
				if(card[i]>card[j]) {
					save=card[j];
					card[j]=card[i];
					card[i]=save;
				}
			}
		} for(int j=0;j<s;j++) {
				if(card[i]>card[j]) {
					save=card[j];
					card[j]=card[i];
					card[i]=save;
				}
			} int j=0; int j=0; j 0 j<s j s j++ j++ j {
				if(card[i]>card[j]) {
					save=card[j];
					card[j]=card[i];
					card[i]=save;
				}
			} {
				if(card[i]>card[j]) {
					save=card[j];
					card[j]=card[i];
					card[i]=save;
				}
			} if(card[i]>card[j]) {
					save=card[j];
					card[j]=card[i];
					card[i]=save;
				} card[i]>card[j] card[i] card i card[j] card j {
					save=card[j];
					card[j]=card[i];
					card[i]=save;
				} save=card[j] save card[j] card j card[j]=card[i] card[j] card j card[i] card i card[i]=save card[i] card i save for(int i=0;i<s;i++) {
			if(i%2==0){
              alice+=card[i];
            }else{
              bob+=card[i];
            }
		} int i=0; int i=0; i 0 i<s i s i++ i++ i {
			if(i%2==0){
              alice+=card[i];
            }else{
              bob+=card[i];
            }
		} {
			if(i%2==0){
              alice+=card[i];
            }else{
              bob+=card[i];
            }
		} if(i%2==0){
              alice+=card[i];
            }else{
              bob+=card[i];
            } i%2==0 i%2 i 2 0 {
              alice+=card[i];
            } alice+=card[i] alice card[i] card i {
              bob+=card[i];
            } bob+=card[i] bob card[i] card 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 sn=new Scanner(System.in);
		int s=sn.nextInt();
		int[] card=new int[101];
		int alice=0;
        int bob=0;
		for(int i=0;i<s;i++) {
			card[i]=sn.nextInt();
		}
		int max=0,save=0;
		for(int i=0;i<s;i++) {
			for(int j=0;j<s;j++) {
				if(card[i]>card[j]) {
					save=card[j];
					card[j]=card[i];
					card[i]=save;
				}
			}
		}
		for(int i=0;i<s;i++) {
			if(i%2==0){
              alice+=card[i];
            }else{
              bob+=card[i];
            }
		}
		System.out.println(alice-bob);
	}
} public class Main {
 
	public static void main(String[] args) {
		Scanner sn=new Scanner(System.in);
		int s=sn.nextInt();
		int[] card=new int[101];
		int alice=0;
        int bob=0;
		for(int i=0;i<s;i++) {
			card[i]=sn.nextInt();
		}
		int max=0,save=0;
		for(int i=0;i<s;i++) {
			for(int j=0;j<s;j++) {
				if(card[i]>card[j]) {
					save=card[j];
					card[j]=card[i];
					card[i]=save;
				}
			}
		}
		for(int i=0;i<s;i++) {
			if(i%2==0){
              alice+=card[i];
            }else{
              bob+=card[i];
            }
		}
		System.out.println(alice-bob);
	}
} Main
import java.util.Scanner;
public class Main {
 
	public static void main(String[] args) {
		Scanner sn=new Scanner(System.in);
		int s=sn.nextInt();
		int[] card=new int[101];
		int alice=0;
        int bob=0;
		for(int i=0;i<s;i++) {
			card[i]=sn.nextInt();
		}
		int max=0,save=0;
		for(int i=0;i<s;i++) {
			for(int j=0;j<s;j++) {
				if(card[i]>card[j]) {
					save=card[j];
					card[j]=card[i];
					card[i]=save;
				}
			}
		}
		for(int i=0;i<s;i++) {
			if(i%2==0){
              alice+=card[i];
            }else{
              bob+=card[i];
            }
		}
		System.out.println(alice-bob);
	}
}