#include "bits/stdc++.h" using namespace std; int main(void){ // Here your code ! int n,a,ans; cin >> n >> ans; while(--n) { cin >> a; if(a <= 0) ans -= a; else if (a == 1) ans += a; else ans *= a; } cout << ans << endl; }