#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main() {
double r, sum=0;
int s;
vector <double> x;
vector <double> y;
while(cin >> r){
if(r<0){
x.push_back(r);
}
else y.push_back(r);
}
s = min(x.size(), y.size());
for(int i=0; i < s; i++){
sum += x[i] * y.back(); /* умножение отрицательных чисел в порядке
следования на неотрицательные в обратном порядке */
y.pop_back();
}
cout << sum;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8YWxnb3JpdGhtPiAKI2luY2x1ZGUgPHZlY3Rvcj4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmludCBtYWluKCkgewoJZG91YmxlIHIsIHN1bT0wOwoJaW50IHM7Cgl2ZWN0b3IgPGRvdWJsZT4geDsKCXZlY3RvciA8ZG91YmxlPiB5OwoJd2hpbGUoY2luID4+IHIpewoJCWlmKHI8MCl7CgkJCXgucHVzaF9iYWNrKHIpOwoJCX0KCQllbHNlIHkucHVzaF9iYWNrKHIpOwoJfQoJcyA9IG1pbih4LnNpemUoKSwgeS5zaXplKCkpOwoJZm9yKGludCBpPTA7IGkgPCBzOyBpKyspewoJCXN1bSArPSB4W2ldICogeS5iYWNrKCk7IC8qINGD0LzQvdC+0LbQtdC90LjQtSDQvtGC0YDQuNGG0LDRgtC10LvRjNC90YvRhSDRh9C40YHQtdC7INCyINC/0L7RgNGP0LTQutC1IAoJCdGB0LvQtdC00L7QstCw0L3QuNGPINC90LAg0L3QtdC+0YLRgNC40YbQsNGC0LXQu9GM0L3Ri9C1INCyINC+0LHRgNCw0YLQvdC+0Lwg0L/QvtGA0Y/QtNC60LUgKi8KCQl5LnBvcF9iYWNrKCk7Cgl9Cgljb3V0IDw8IHN1bTsKCXJldHVybiAwOwp9