import java.util.*;
import java.lang.*;
import java.io.*;
class Ideone
{
{
Scanner in
= new Scanner
(System.
in); int m, n;
m = in.nextInt();
n = in.nextInt();
double[] a = new double[m*n+1];
double sum1 = 1, sum2 = 1, sum3 = 1;
for (int i = 1; i <= m*n; i++)
{
a[i] = in.nextDouble();
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];
}
}
System.
out.
println(sum1
+ sum2
+ sum3
); }
}
aW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgpjbGFzcyBJZGVvbmUKewoJcHVibGljIHN0YXRpYyB2b2lkIG1haW4gKFN0cmluZ1tdIGFyZ3MpIHRocm93cyBqYXZhLmxhbmcuRXhjZXB0aW9uCgl7CgkJU2Nhbm5lciBpbiA9IG5ldyBTY2FubmVyKFN5c3RlbS5pbik7CgkJaW50IG0sIG47CgkJbSA9IGluLm5leHRJbnQoKTsKCQluID0gaW4ubmV4dEludCgpOwoJCWRvdWJsZVtdIGEgPSBuZXcgZG91YmxlW20qbisxXTsKCQlkb3VibGUgc3VtMSA9IDEsIHN1bTIgPSAxLCBzdW0zID0gMTsKCQlmb3IgKGludCBpID0gMTsgaSA8PSBtKm47IGkrKykKCQl7CgkJCWFbaV0gPSBpbi5uZXh0RG91YmxlKCk7CgkJCWlmIChpIDw9IG0pCgkJCXsKCQkJCXN1bTEgKj0gYVtpXTsKCQkJfQoJCQlpZiAoKGkgPiBtKSAmJiAoaSA8PSAyKm0pKQoJCQl7CgkJCQlzdW0yICo9IGFbaV07CgkJCX0KCQkJaWYgKChpID4gKG4gLSAxKSptKSAmJiAoaSA8PSBuKm0pKQoJCQl7CgkJCQlzdW0zICo9IGFbaV07CgkJCX0KCQl9CgkJU3lzdGVtLm91dC5wcmludGxuKHN1bTEgKyBzdW0yICsgc3VtMyk7IAoJfQp9