#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vvl = vector<vector<ll>>;
using vvi = vector<vector<int>>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
const ll M = 1000000009LL;
const ll INF = 1e16;
const long double eps = 1e-7;
const long double Pi = acosl(-1.0);
int main() {
  ios_base::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  vector<int> a(m);
  vector<int> cap(100);
  for (int i = 0; i < m; ++i) {
    cin >> a[i];
    cap[a[i] - 1]++;
  }
  sort(cap.rbegin(), cap.rend());
  int max_dur = 0;
  for (int dur = 1; dur <= m / n; ++dur) {
    int max_survive = 0;
    for (int i = 0; i < 100; ++i) {
      max_survive += cap[i] / dur;
    }
    if (max_survive >= n) {
      max_dur = dur;
    } else {
      break;
    }
  }
  cout << max_dur;
  return 0;
}
