#include using namespace std; #define FOR(i,a,b) for(int i=(a);i<(b);i++) #define REP(i,n) FOR(i,0,n) #define ALL(v) (v).begin(),(v).end() template inline bool chmax(A &a, B b) { if (a inline bool chmin(A &a, B b) { if (a>b) { a=b; return 1; } return 0; } typedef unsigned long long ull; typedef long long ll; typedef pair pii; typedef pair pll; typedef pair P; const ll INF = 1ll<<29; const ll MOD = 1000000007; const double EPS = 1e-10; int n; vector a; int main() { cin >> n; REP(i, n) { int in; scanf("%d", &in); a.push_back(in); } int necnt = 0, one = 0; REP(i, n) { if (a[i] < 0) { if (i != 0 && a[i] == -1) one++; else necnt++; } } int ma = -INF; FOR(i, 1, n) if (a[i] < 0) chmax(ma, a[i]); if (necnt % 2 == 0) ma = -INF; ll ans = 1; REP(i, n) { if (i != 0 && a[i] == ma) { ans += -a[i]; ma = -INF; } else if (i != 0 && a[i] == -1) { ans++; } else if (a[i] == 1) { ans++; } else { ans *= abs(a[i]); } } cout << ans << endl; return 0; }