#P317. 【例54.2】 学生组队

【例54.2】 学生组队

Description

Ke has become the coach of a school's programming competition team. Now, she needs to pair up all nn students in the training team. Each student has an ability value, and only two students with the same ability value can form a team.
Of course, students can also improve their ability by solving problems. Each time a student solves a problem, their ability value increases by one.
Ke wants to know the minimum number of problems that need to be solved so that all students can be paired up.

Input Format

The first line contains an integer nn (2n1002≤n≤100), which is guaranteed to be even.
The second line contains nn integers, representing the ability values aia_i of each student (2ai1002≤a_i≤100).

Output Format

Output a single integer—the minimum number of problems that need to be solved so that all students can be paired up.

Sample

6
5 10 2 3 14 5
5