#include <bits/stdc++.h>
using namespace std;
long long get_rand() {
  long long a = rand(), ft = 31, b = rand();
  return (a << ft) ^ b;
}
int gcd(int a, int b) {
  while (a && b) {
    a %= b;
    swap(a, b);
  }
  return a + b;
}
int b[102];
bool go(int k, int n) {
  for (int j = 0; j < 101; j++) {
    n -= b[j] / k;
  }
  return n <= 0;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, m;
  cin >> m >> n;
  int a;
  for (int j = 0; j < n; ++j) {
    cin >> a;
    b[a]++;
  }
  int j;
  for (j = 100; j > 0; --j) {
    if (go(j, m)) {
      cout << j;
      return 0;
    }
  }
  cout << j;
}
