#include <bits/stdc++.h>
using namespace std;
inline void get(int &res) {
  char ch;
  while (!isdigit(ch = getchar()))
    ;
  for (res = ch - '0'; isdigit(ch = getchar()); res = res * 10 + ch - '0')
    ;
}
int n, m;
double P[3005][305], g[305][3005], F[305], inc[3005];
struct cmp {
  bool operator()(const int &a, const int &b) {
    if (inc[a] != inc[b]) return inc[a] > inc[b];
    return a < b;
  }
};
set<int, cmp> st;
int main() {
  get(n), get(m);
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) {
      scanf("%lf", &P[i][j]);
      P[i][j] /= 1000.0;
    }
  for (int i = 1; i <= m; i++) {
    g[i][0] = 1.0;
    for (int j = 1; j <= n; j++) g[i][j] = g[i][j - 1] * (1 - P[j][i]);
    inc[i] = 1 - g[i][n];
    st.insert(i);
  }
  double ans = 0;
  for (int cl = 1, Maxloc; cl <= n; cl++) {
    Maxloc = *st.begin();
    st.erase(st.begin());
    ans += inc[Maxloc];
    for (int i = 0; i <= n; i++) F[i] = g[Maxloc][i];
    g[Maxloc][0] = 0;
    for (int i = 1; i <= n; i++)
      g[Maxloc][i] =
          g[Maxloc][i - 1] * (1 - P[i][Maxloc]) + F[i - 1] * P[i][Maxloc];
    inc[Maxloc] -= g[Maxloc][n];
    st.insert(Maxloc);
  }
  printf("%.12lf", ans);
}
