#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n];
  int i = 0;
  for (i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  int sum = 0;
  for (i = 0; i < n; i++) {
    if (a[i] < 0) {
      sum = sum - a[i];
    } else {
      sum = sum + a[i];
    }
  }
  cout << sum << endl;
}
