#include using ll = long long; #define rep(i, n) for (int i = 0; i < n; ++i) using namespace std; int main() { int n; cin >> n; vector a(n); rep(i, n) cin >> a[i]; sort(a.rbegin(), a.rend()); rep(i, n - 1) if (abs(a[i]) > abs(a[i + 1])) a[i + 1] = a[i]; ll ans = 0; rep(i, n) ans += abs(a[i]); cout << ans << "\n"; }