#include using namespace std; int main() { int n; cin >> n; vector c(n); for (int i = 0; i < n; i++){ cin >> c[i]; } sort(c.begin(), c.end()); long long a = 0, b = 0; for (int i = 0; i < n; i++){ if (i % 2 == 0){ a += c[i]; }else{ b += c[i]; } } cout << abs(abs(a) - abs(b)) << endl; }