#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int maxx = 0, minn = 0;
  while (n--) {
    int temp;
    cin >> temp;
    if (temp >= 0)
      maxx += temp;
    else
      minn += temp;
  }
  cout << maxx - minn << endl;
  return 0;
}
