#include <bits/stdc++.h>
using namespace std;
const int N = 3005;
const int M = 305;
int n, m, pos;
double a[N][N], ans, mx, f[M][N], Sf[M], g[M], tmp[N];
void calc(int c) {
  for (int i = 1; i <= n; i++) tmp[i] = f[c][i - 1] * a[i][c];
  f[c][0] = 0;
  for (int i = 1; i <= n; i++) f[c][i] = f[c][i - 1] * (1 - a[i][c]) + tmp[i];
  Sf[c] += f[c][n];
  g[c] = 1 - Sf[c];
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) scanf("%lf", &a[i][j]), a[i][j] /= 1000;
  for (int i = 1; i <= m; i++) {
    f[i][0] = 1;
    for (int j = 1; j <= n; j++) f[i][j] = f[i][j - 1] * (1 - a[j][i]);
    Sf[i] = f[i][n];
    g[i] = 1 - Sf[i];
  }
  for (int i = 1; i <= n; i++) {
    mx = 0;
    pos = 0;
    for (int j = 1; j <= m; j++)
      if (g[j] > mx) mx = g[j], pos = j;
    calc(pos);
    ans += mx;
  }
  printf("%.10lf\n", ans);
  return 0;
}
