#include <iostream>
#include <vector>
using namespace std;
int main() {
vector <double> x;
double a,m=0,k=0,n=0;
while(cin>>a){
x.push_back(a);
}
for(int i=0;i<x.size();i++)n+=x[i];
for(int i=0;i<x.size();i++){
if(i==0)k=x[0];
else k*=x[i];
}
for(int i=0;i<x.size();i++){
if(x[i]<0)x[i]=x[i]*x[i];
if(x[i]<m){
m=0;
break;
}
m=x[i];
}
if(m!=0){
cout<<n;
}
else {
cout<<k;
}
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8dmVjdG9yPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwogCmludCBtYWluKCkgewoJdmVjdG9yIDxkb3VibGU+IHg7IAoJZG91YmxlIGEsbT0wLGs9MCxuPTA7Cgl3aGlsZShjaW4+PmEpeyAgICAgCgkJeC5wdXNoX2JhY2soYSk7ICAKCX0KCWZvcihpbnQgaT0wO2k8eC5zaXplKCk7aSsrKW4rPXhbaV07IAoJZm9yKGludCBpPTA7aTx4LnNpemUoKTtpKyspewoJCWlmKGk9PTApaz14WzBdOwoJCWVsc2Ugayo9eFtpXTsKCQl9Cglmb3IoaW50IGk9MDtpPHguc2l6ZSgpO2krKyl7ICAKCQlpZih4W2ldPDApeFtpXT14W2ldKnhbaV07CgkJaWYoeFtpXTxtKXsgCgkJCW09MDsKCQkJYnJlYWs7CgkJfQoJCW09eFtpXTsKCX0KCWlmKG0hPTApeyAKCQljb3V0PDxuOwoJfQoJZWxzZSB7CgkJY291dDw8azsgCgl9Cn0=