#include <bits/stdc++.h>
using namespace std;
int n, m;
double a[310], f[3100][310], p[3100][310], ans = 0;
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1, x; i <= n; ++i)
    for (int j = 1; j <= m; ++j) scanf("%d", &x), p[i][j] = x * 0.001;
  for (int j = 1; j <= m; ++j) {
    f[0][j] = 1;
    for (int i = 1; i <= n; ++i) f[i][j] = f[i - 1][j] * (1 - p[i][j]);
    a[j] = 1 - f[n][j];
  }
  for (int i = 1; i <= n; ++i) {
    int k = 1;
    for (int j = 2; j <= m; ++j)
      if (a[k] < a[j]) k = j;
    ans += a[k];
    double x = f[0][k], y;
    f[0][k] = 0;
    for (int j = 1; j <= n; ++j)
      y = f[j - 1][k] * (1 - p[j][k]) + x * p[j][k], x = f[j][k], f[j][k] = y;
    a[k] -= f[n][k];
  }
  printf("%.12lf\n", ans);
  return 0;
}
