There are $n$ students in a university. The number of students is even. The $i$-th student has programming skill equal to $a_i$. 

The coach wants to form $\frac{n}{2}$ teams. Each team should consist of exactly two students, and each student should belong to exactly one team. Two students can form a team only if their skills are equal (otherwise they cannot understand each other and cannot form a team).

Students can solve problems to increase their skill. One solved problem increases the skill by one.

The coach wants to know the minimum total number of problems students should solve to form exactly $\frac{n}{2}$ teams (i.e. each pair of students should form a team). Your task is to find this number.


-----Input-----

The first line of the input contains one integer $n$ ($2 \le n \le 100$) — the number of students. It is guaranteed that $n$ is even.

The second line of the input contains $n$ integers $a_1, a_2, \dots, a_n$ ($1 \le a_i \le 100$), where $a_i$ is the skill of the $i$-th student.


-----Output-----

Print one number — the minimum total number of problems students should solve to form exactly $\frac{n}{2}$ teams.


-----Examples-----
Input
6
5 10 2 3 14 5

Output
5

Input
2
1 100

Output
99



-----Note-----

In the first example the optimal teams will be: $(3, 4)$, $(1, 6)$ and $(2, 5)$, where numbers in brackets are indices of students. Then, to form the first team the third student should solve $1$ problem, to form the second team nobody needs to solve problems and to form the third team the second student should solve $4$ problems so the answer is $1 + 4 = 5$.

In the second example the first student should solve $99$ problems to form a team with the second one.

Difficulty: introductory

Starter code:

Solutions:
def solve():
    n = int(input())
    A = [int(k) for k in input().split()]
    
    A.sort()
    
    ans = 0
    
    for i in range(0,n,2):
        ans += (A[i+1] - A[i])
        
    print (ans)
    
solve()

input()
l = list(map(int,input().split()))
l.sort()
n = 0
for x in range(len(l)//2):
    n += l[x*2+1]-l[x*2]
print(n)

import math, sys
from fractions import *

def mp():
    return list(map(int, input().split()))

def main():
    n = int(input())
    a = sorted(mp())
    i = 0
    ans = 0 
    while i < n:
        ans += a[i + 1] - a[i]
        i += 2
    print(ans)
        
deb = 0
if deb:
    file = open('input.txt', 'w')
else:
    input = sys.stdin.readline
    
main()

n = int(input())
a = [int(x) for x in input().split()]
a = sorted(a)
#print(a)
c = 0
for i in range(1,n,2):
    c = c + a[i] - a[i-1]
print(c)

#JMD
#Nagendra Jha-4096

 
import sys
import math

#import fractions
#import numpy
 
###File Operations###
fileoperation=0
if(fileoperation):
    orig_stdout = sys.stdout
    orig_stdin = sys.stdin
    inputfile = open('W:/Competitive Programming/input.txt', 'r')
    outputfile = open('W:/Competitive Programming/output.txt', 'w')
    sys.stdin = inputfile
    sys.stdout = outputfile

###Defines...###
mod=1000000007
 
###FUF's...###
def nospace(l):
    ans=''.join(str(i) for i in l)
    return ans
 
 
 
##### Main ####
t=1
for tt in range(t):
    n=int(input())
    a=list(map(int,sys.stdin.readline().split(' ')))
    ans=0

    a.sort()
    for i in range(0,n-1,2):
    	ans+=abs(a[i]-a[i+1])
    print(ans)
    #n,k,s= map(int, sys.stdin.readline().split(' '))
    
    
#####File Operations#####
if(fileoperation):
    sys.stdout = orig_stdout
    sys.stdin = orig_stdin
    inputfile.close()
    outputfile.close()

def mi():
	return list(map(int, input().split()))
'''

'''

n = int(input())
a = list(mi())

a.sort()
s = 0
for i in range(n):
	if i%2:
		continue
	s+=abs(a[i+1]-a[i])
print (s)


MOD = 10**9 + 7
I = lambda:list(map(int,input().split()))

n, = I()
l = I()
l.sort()
count = 0
for i in range(0, n, 2):
    count += abs(l[i] - l[i+1])
print(count)

n = int(input())
a = list(map(int, input().split()))
a.sort()
ans = 0
for i in range(n // 2):
    ans += a[2 * i] - a[2 * i + 1]
print(-ans)

from sys import stdin
n=int(stdin.readline().strip())
s=list(map(int,stdin.readline().strip().split()))
s.sort()
ans=0
for i in range(0,n,2):
    ans+=s[i+1]-s[i]
print(ans)


n = int(input())
a = list(map(int, input().split()))
a.sort()
ans = 0
for i in range(0, n, 2):
    ans += a[i + 1] - a[i]
print(ans)


n = int(input())
a = list(map(int, input().split()))
a.sort()
c = 0
for i in range(0, n, 2):
    c += a[i + 1] - a[i]
print(c)


from bisect import bisect_right as br
from bisect import bisect_left as bl
from collections import defaultdict
from itertools import combinations
import sys
import math
MAX = sys.maxsize
MAXN = 10**6+10
MOD = 998244353
def isprime(n):
    n = abs(int(n))
    if n < 2:
        return False
    if n == 2: 
        return True    
    if not n & 1: 
        return False
    for x in range(3, int(n**0.5) + 1, 2):
        if n % x == 0:
            return False
    return True

def mhd(a,b,x,y):
    return abs(a-x)+abs(b-y)

def numIN():
    return(list(map(int,sys.stdin.readline().strip().split())))

def charIN():
    return(sys.stdin.readline().strip().split())

t = [(-1,-1)]*1000010

def create(a):
	nonlocal t,n
	for i in range(n,2*n):
		t[i] = (a[i-n],i-n)
	for i in range(n-1,0,-1):
		x = [t[2*i],t[2*i+1]]
		x.sort(key = lambda x:x[0])
		t[i] = x[1]

def update(idx,value):
	nonlocal t,n
	idx = idx+n
	t[idx] = value

	while(idx>1):
		idx = idx//2
		x = [t[2*idx],t[2*idx+1]]
		x.sort(key = lambda x:x[0])
		t[idx] = x[1]


def dis(a,b,k):
	ans = 0
	for i in range(k):
		ans+=abs(a[i]-b[i])
	return ans


def cal(n,k):
	res = 1
	c = [0]*(k+1)
	c[0]=1
	for i in range(1,n+1):
	    for j in range(min(i,k),0,-1):
	        c[j] = (c[j]+c[j-1])%MOD
	return c[k]


n = int(input())
l = list(numIN())
l.sort()
ans = 0
for i in range(1,n,2):
	ans+=l[i]-l[i-1]
print(ans)






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

A.sort()
ANS=0
for i in range(n//2):
    ANS+=A[2*i+1]-A[2*i]

print(ANS)


n = int(input())

seq = sorted(list(map(int, input().split())))

ans = 0
for i in range(0, n, 2):
	ans += seq[i+1] - seq[i]
print(ans)


def ii():
    return int(input())
def mi():
    return list(map(int, input().split()))
def li():
    return list(mi())

n = ii()
a = li()
a.sort()
ans = sum(a[i + 1] - a[i] for i in range(0, n, 2))
print(ans)


n = int(input())
a = sorted(list(map(int, input().split())))
answer = 0
for q in range(0, n, 2):
    answer += a[q+1]-a[q]
print(answer)


n = int(input())
a = sorted(list(map(int, input().split())))
cnt = 0
for i in range(0, n, 2):
    cnt += a[i + 1] - a[i]
print(cnt)

n = int(input())
a = sorted([int(i) for i in input().split()])


s = 0
for i in range(0,n,2):
	s += abs(a[i+1]-a[i])

print(s)



n = int(input())
a = list(map(int, input().split()))
a.sort()
s = 0
for i in range(n // 2):
	s += a[2 * i + 1] - a[2 * i]
print(s)



n = int(input())
mass = list(map(int, input().split()))
mass.sort()
cnt = 0
for i in range(0, n, 2):
    cnt += mass[i+1] - mass[i]
print(cnt)

#codeforces _10892B_live
gi = lambda : list(map(int,input().split()))
n, = gi()
l = gi()
ans = 0
l.sort()
for k in range(0,n,2):
	ans += l[k+1] - l[k]
print(ans)

# alpha = "abcdefghijklmnopqrstuvwxyz"
t = 1#int(input())
for test in range(t):
    n = int(input())
    a = list(map(int, input().split()))
    a.sort()
    ans = [-a[2*i]+a[2*i+1] for i in range(n//2)]
    print(sum(ans))


n=int(input())
arr=list(map(int,input().split()))
ans=0
arr.sort()
for i in range(0,n,2):
    ans+=arr[i+1]-arr[i]
print(ans)

n = int(input())
a = list(map(int, input().split()))
a.sort()
s = 0
for i in range(n//2):
  s += a[2*i+1]-a[2*i]
print(s)