#include <bits/stdc++.h>
using namespace std;
const int N = 1005;
long long ara[N];
int main() {
  long long n, m;
  cin >> n >> m;
  for (long long i = 0; i < m; ++i) {
    long long x;
    cin >> x;
    ++ara[x];
  }
  vector<long long> v;
  for (long long i = 1; i <= 100; ++i) {
    if (ara[i] != 0) v.push_back(ara[i]);
  }
  long long mx = 0;
  for (long long i = 1; i <= 100; ++i) {
    long long s = 0;
    for (long long j = 0; j < v.size(); ++j) {
      s += v[j] / i;
    }
    if (s >= n) mx = max(mx, i);
  }
  cout << mx;
}
