#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  while (cin >> n) {
    vector<int> v(n);
    for (int i = 0; i < n; ++i) cin >> v[i];
    sort(v.begin(), v.end());
    int c = accumulate(v.begin(), v.end(), 0);
    int b = 0;
    int ans = -1e9;
    for (int i = 0; i < n; ++i) {
      ans = max(c - b, ans);
      ans = max(b - c, ans);
      b += v[i];
      c -= v[i];
    }
    cout << ans << endl;
  }
  return 0;
}
