#include <bits/stdc++.h>
using namespace std;
const int Inf = 1e9;
const int mod = 1e9 + 7;
int judge(int x, vector<int>& a) {
  int cnt = 0;
  for (auto& v : a) {
    cnt += v / x;
  }
  return cnt;
}
int main() {
  ios::sync_with_stdio(0);
  int n, m;
  cin >> n >> m;
  vector<int> a(105, 0);
  for (int i = 0; i < m; ++i) {
    int t;
    cin >> t;
    a[t]++;
  }
  int ans = 0;
  vector<int> b;
  for (int i = 1; i < 105; ++i) {
    if (a[i]) {
      b.push_back(a[i]);
    }
  }
  sort(b.begin(), b.end());
  int l = 1, r = 105;
  while (l <= r) {
    int mid = (l + r) / 2;
    if (judge(mid, b) >= n) {
      ans = mid;
      l = mid + 1;
    } else {
      r = mid - 1;
    }
  }
  cout << ans << endl;
  return 0;
}
