#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
int m, n;
cin >> m >> n;
double a[m*n];
double sum1 = 1, sum2 = 1, sum3 = 1;
double sum = 0;
for (int i = 1; i <= m*n; i++)
{
cin >> a[i];
if (i <= m)
{
sum1 *= a[i];
}
if ((i > m) && (i <= 2*m))
{
sum2 *= a[i];
}
if ((i > (n - 1)*m) && (i <= n*m))
{
sum3 *= a[i];
}
}
cout << setprecision(15) << sum1 + sum2 + sum3;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8aW9tYW5pcD4gIAp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSAKewoJaW50IG0sIG47CgljaW4gPj4gbSA+PiBuOwoJZG91YmxlIGFbbSpuXTsKCWRvdWJsZSBzdW0xID0gMSwgc3VtMiA9IDEsIHN1bTMgPSAxOwoJZG91YmxlIHN1bSA9IDA7Cglmb3IgKGludCBpID0gMTsgaSA8PSBtKm47IGkrKykKCXsKCQljaW4gPj4gYVtpXTsKCQlpZiAoaSA8PSBtKQoJCXsKCQkJc3VtMSAqPSBhW2ldOwoJCX0KCQlpZiAoKGkgPiBtKSAmJiAoaSA8PSAyKm0pKQoJCXsKCQkJc3VtMiAqPSBhW2ldOwoJCX0KCQlpZiAoKGkgPiAobiAtIDEpKm0pICYmIChpIDw9IG4qbSkpCgkJewoJCQlzdW0zICo9IGFbaV07CgkJfQoJfQoJY291dCA8PCBzZXRwcmVjaXNpb24oMTUpIDw8IHN1bTEgKyBzdW0yICsgc3VtMzsgCglyZXR1cm4gMDsKfQ==