#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int s = 0;
  char c;
  while ((c = getchar()) < '0' || c > '9')
    ;
  do {
    s = s * 10 + c - '0';
  } while ((c = getchar()) >= '0' && c <= '9');
  return s;
}
const int N = 3010, M = 310;
int n, m, rp[M];
double f[M][2][N], tp[N][M];
priority_queue<pair<double, int> > h;
double nxdp(int i) {
  int p = (++rp[i]) & 1;
  if (rp[i] > n) return -1e9;
  f[i][p][0] = 0;
  for (int k = 1; k <= n; k++)
    f[i][p][k] =
        tp[k][i] * f[i][p ^ 1][k - 1] + (1 - tp[k][i]) * f[i][p][k - 1];
  return f[i][p][n];
}
double work() {
  int i, k;
  double ans = 0;
  for (i = 1; i <= m; i++)
    for (k = 0; k <= n; k++) f[i][0][k] = 1;
  for (i = 1; i <= m; i++) h.push(make_pair(nxdp(i), i));
  for (i = 1; i <= n; i++) {
    pair<double, int> t = h.top();
    h.pop();
    ans += t.first;
    h.push(make_pair(nxdp(t.second), t.second));
  }
  return ans;
}
int main() {
  int i, j;
  n = read(), m = read();
  for (i = 1; i <= n; i++)
    for (j = 1; j <= m; j++) tp[i][j] = read() * 0.001;
  printf("%.11lf\n", work());
  return 0;
}
