#include <bits/stdc++.h>
using namespace std;
int main() {
  short n;
  cin >> n;
  vector<short> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a.begin(), a.end(), greater<short>());
  int diff = a[0] > 0 ? a[0] : -a[0];
  for (int i = 1; i < n; i++) {
    if (a[i] >= 0)
      diff += a[i];
    else
      diff -= a[i];
  }
  cout << diff;
  return 0;
}
