4986: 学生组队

Memory Limit:128 MB Time Limit:1.000 S
Judge Style:Text Compare Creator:
Submit:4 Solved:3

Description

有n个学生,每个学生有能力值,能力值相同的两个人才能组队
学生可以通过做题来提升能力值,做一题加一点
这些学生最少总共需要做多少题才能都组上队

Input

第1行包含一个整数n,保证为偶数,范围是 [2, 100]
第2行包含n个整数,为每个学生的能力值,范围是 [2, 100]

Output

一个整数,表示学生至少要做的题

Sample Input Copy

6
5 10 2 3 14 5

Sample Output Copy

5