#include <bits/stdc++.h>
using namespace std;
const int inf = 1 << 30;
const long long INF = 1LL << 60;
const int MaxN = 100005;
int n;
int a[105];
int sum[105];
int main() {
  while (scanf("%d", &n) != EOF) {
    for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
    sort(a + 1, a + n + 1);
    sum[0] = 0;
    for (int i = 1; i <= n; i++) sum[i] = sum[i - 1] + a[i];
    int ans = 0;
    for (int i = 1; i <= n; i++) {
      int L = sum[i - 1];
      int R = sum[n] - sum[i - 1];
      ans = max(ans, abs(R - L));
    }
    ans = max(ans, -sum[n]);
    printf("%d\n", ans);
  }
  return 0;
}
