#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n;
  int a[5005] = {0};
  int zc = 0, oc = 0;
  int count = 0;
  int c2 = 0;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i];
    if (a[i] >= 0)
      count += a[i];
    else
      c2 += a[i];
  }
  cout << count - c2 << endl;
  return 0;
}
