#include <bits/stdc++.h>
using namespace std;
void DA() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
void palindrom(string s) {
  bool t = true;
  int i, j, l;
  i = 0, j = s.length() - 1, l = (s.length()) / 2;
  while (j > i) {
    if (s[i++] == s[j--]) {
      if ((s[i] == 'A' || s[i] == 'H' || s[i] == 'I' || s[i] == 'M' ||
           s[i] == 'O' || s[i] == 'T' || s[i] == 'U' || s[i] == 'V' ||
           s[i] == 'W' || s[i] == 'X' || s[i] == 'Y') &&
          (s[j] == 'A' || s[j] == 'H' || s[j] == 'I' || s[j] == 'M' ||
           s[j] == 'O' || s[j] == 'T' || s[j] == 'U' || s[j] == 'V' ||
           s[j] == 'W' || s[j] == 'X' || s[j] == 'Y')) {
        t = true;
      } else
        t = false;
    } else
      t = false;
  }
  if (t == false)
    cout << "no" << endl;
  else
    cout << "yes" << endl;
}
int main() {
  DA();
  int n, B = 0, C = 0, x;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> x;
    if (x >= 0)
      B += x;
    else
      C += x;
  }
  cout << B - C << endl;
  return 0;
}
