#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  multiset<int> s;
  int a;
  for (int i = 0; i < n; i++) {
    cin >> a;
    s.insert(a);
  }
  multiset<int>::iterator it = s.begin();
  int sum1 = 0;
  int sum2 = 0;
  for (it; it != s.end(); it++) {
    if (*it < 0)
      sum1 += *it;
    else
      sum2 += *it;
  }
  cout << sum2 - sum1;
  return 0;
}
