#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, m, i, j, k;
  cin >> n >> m;
  int a[101] = {0};
  for (i = 0; i < m; i++) {
    cin >> j;
    a[j]++;
  }
  vector<int> v;
  for (i = 1; i <= 100; i++) {
    if (a[i] != 0) v.push_back(a[i]);
  }
  sort(v.rbegin(), v.rend());
  j = m / n;
  if (j == 0)
    cout << j;
  else {
    for (i = j; i >= 1; i--) {
      int x = 0;
      for (k = 0; k < v.size(); k++) {
        x += (v[k] / i);
      }
      if (x >= n) break;
    }
    cout << i;
  }
}
