#include using namespace std; typedef long long ll; int main(void) { int N; cin >> N; int a; ll ans = 0; for (int i=0; i> a; if (a < 0) ans += -a; else { if (ans <= 0 || a <= 1) ans += a; else ans *= a; } } cout << ans << endl; return 0; }