#include <bits/stdc++.h>
using namespace std;
const int oo = 1047483647, maxn = 3100, maxm = 310;
int n, i, j, k, m, r;
double a[maxn][maxm], x[maxn][maxm], ans, c[maxn];
bool sol;
int main() {
  scanf("%d%d", &n, &m);
  for (i = 1; i <= n; i++)
    for (j = 1; j <= m; j++) {
      scanf("%lf", a[i] + j);
      a[i][j] /= 1000;
    }
  for (j = 1; j <= m; j++) {
    x[0][j] = 1;
    for (i = 1; i <= n; i++) x[i][j] = x[i - 1][j] * (1 - a[i][j]);
    for (i = 0; i <= n; i++) x[i][j] = 1 - x[i][j];
  }
  for (r = 1; r <= n; r++) {
    k = 1;
    for (j = 2; j <= m; j++)
      if (x[n][j] > x[n][k]) k = j;
    ans += x[n][k];
    for (i = 1; i <= n; i++) c[i] = x[i][k];
    for (i = 1; i <= n; i++)
      x[i][k] = c[i - 1] * a[i][k] + x[i - 1][k] * (1 - a[i][k]);
  }
  printf("%.15lf", ans);
  return 0;
}
