#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, B = 0, C = 0;
  cin >> n;
  vector<int> vec;
  vec.resize(n);
  for (int i = 0; i < n; i++) {
    cin >> vec[i];
  }
  for (int i = 0; i < n; i++) {
    if (vec[i] >= 0) {
      B += vec[i];
    } else {
      C += vec[i];
    }
  }
  cout << abs(B - C) << endl;
}
