#include <bits/stdc++.h>
using namespace std;
long long int gcd(long long int a, long long int b) {
  return b ? gcd(b, a % b) : a;
}
long long int power(long long int a, long long int b) {
  long long int ans = 1;
  while (b) {
    if (b & 1) {
      ans = (ans * a) % 1000000007;
    }
    a = (a * a) % 1000000007;
    b >>= 1;
  }
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n, m;
  cin >> n >> m;
  vector<long long int> v;
  map<long long int, long long int> food;
  long long int j, ans = 0;
  for (long long int i = 0; i < m; i++) {
    cin >> j;
    v.push_back(j);
    food[j]++;
  }
  if (n > m) {
    cout << "0\n";
    exit(0);
  }
  map<long long int, long long int>::iterator it;
  for (long long int i = 100; i > 0; i--) {
    long long int val = 0;
    for (it = food.begin(); it != food.end(); it++) {
      val += (it->second) / i;
      if (val >= n) {
        cout << i << "\n";
        exit(0);
      }
    }
  }
  return 0;
}
