#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int mi = -101;
  int z = 0, f = 0;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    int x;
    scanf("%d", &x);
    if (x >= 0)
      z += x;
    else
      f += x;
    mi = min(mi, x);
  }
  if (f == 0) {
    return 0 * printf("%d", z);
  }
  printf("%d", z - f);
  return 0;
}
