#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, i, j, y = 0;
  cin >> n >> k;
  vector<int> v;
  int a[10001];
  int b[10001];
  for (i = 1; i <= k; i++) {
    cin >> a[i];
    b[a[i]]++;
  }
  for (i = 1; i <= 100; i++) {
    if (b[i] > 0) v.push_back(b[i]);
  }
  sort(v.begin(), v.end());
  reverse(v.begin(), v.end());
  int cnt, f;
  int d = v.size();
  for (i = 1; i <= 100; i++) {
    cnt = 0, f = 0;
    for (j = 0; j < min(n, d); j++) {
      cnt = cnt + v[j] / i;
      if (cnt >= n) {
        f = 1;
        break;
      }
    }
    if (f == 0) break;
  }
  cout << i - 1;
}
