#include <bits/stdc++.h>
using namespace std;
int n, m;
double ans, del[305], f[305][3005], p[3005][305];
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++)
    for (int j = 1, p1; j <= m; j++) scanf("%d", &p1), p[i][j] = p1 / 1000.0;
  for (int i = 1; i <= m; i++) {
    f[i][0] = 1.0;
    for (int j = 1; j <= n; j++) f[i][j] = f[i][j - 1] * (1 - p[j][i]);
    del[i] = 1.0 - f[i][n];
  }
  for (int t = 1; t <= n; t++) {
    int k = max_element(del + 1, del + 1 + m) - del;
    ans += del[k];
    for (int i = n; i >= 1; i--) f[k][i] = f[k][i - 1] * p[i][k];
    f[k][0] = 0;
    for (int i = 2; i <= n; i++) f[k][i] += f[k][i - 1] * (1.0 - p[i][k]);
    del[k] -= f[k][n];
  }
  printf("%.12lf", ans);
}
