#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  multiset<int> pos, neg;
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    if (a[i] > 0)
      pos.insert(a[i]);
    else
      neg.insert(a[i]);
  }
  int b = 0, c = 0;
  for (auto it = pos.begin(); it != pos.end(); ++it) {
    b += (*it);
  }
  for (auto it = neg.begin(); it != neg.end(); ++it) {
    c += (*it);
  }
  cout << b - c << endl;
  return 0;
}
