Module Module088B
    Sub Main(ByVal args() As String)
        Dim N As Integer
        Dim i, j As Integer
        Dim tmp As Integer

        Dim Alice As Integer : Alice = 0
        Dim Bob As Integer : Bob = 0

        N = Console.ReadLine()
        Dim arr(N - 1) As String
        Dim arr_i(N - 1) As Integer
        arr = Split(Console.ReadLine())

        For i = 0 To N - 1
            arr_i(i) = Integer.Parse(arr(i))
        Next

        '入力をソートする
        For i = 0 To N - 1
            For j = N - 1 To i Step -1
                If arr_i(j) < arr_i(i) Then
                    tmp = arr_i(j)
                    arr_i(j) = arr_i(i)
                    arr_i(i) = tmp
                End If
            Next
        Next

        For i = 0 To N - 1
            'iが偶数の場合はAlice 
            If i Mod 2 = 0 Then
                Alice = Alice + arr_i(N - 1 - i)
            Else
                Bob = Bob + arr_i(N - 1 - i)
            End If
        Next

        Console.Write(Alice - Bob)

    End Sub
End Module
