#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const int maxn = 105;
inline void read(int &x) {
  int f = 1;
  x = 0;
  char s = getchar();
  while (s < '0' || s > '9') {
    if (s == '-') f = -1;
    s = getchar();
  }
  while (s >= '0' && s <= '9') {
    x = x * 10 + s - '0';
    s = getchar();
  }
  x *= f;
}
inline void print(int x) {
  if (x < 0) {
    putchar('-');
    x = -x;
  }
  if (x > 9) print(x / 10);
  putchar(x % 10 + '0');
}
inline void caltime(int tt) {
  tt = clock() - tt;
  cerr << (double)tt / CLOCKS_PER_SEC << " seconds!" << endl;
}
int n, m, a[maxn], num[maxn];
int main() {
  memset(num, 0, sizeof(num));
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    read(a[i]);
    num[a[i]]++;
  }
  if (n > m) {
    cout << 0 << endl;
    return 0;
  }
  sort(num + 1, num + maxn + 1, greater<int>());
  int j = 1, tot = 0;
  while (1) {
    tot = 0;
    j++;
    for (int i = 1; i <= n; i++) {
      tot += num[i] / j;
    }
    if (tot >= n) {
      continue;
    } else {
      break;
    }
  }
  cout << j - 1;
  return 0;
}
