#include <bits/stdc++.h>
const int N = 1e5 + 50;
using namespace std;
int n, m, h, tot, mx, maxn, ans;
int a[N], b[N], cnt[N], num[N];
int read() {
  int s = 0, t = 1;
  char c;
  while (c < '0' || c > '9') {
    if (c == '-') t = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    s = s * 10 + c - '0';
    c = getchar();
  }
  return s * t;
}
long long readl() {
  long long s = 0, t = 1;
  char c;
  while (c < '0' || c > '9') {
    if (c == '-') t = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    s = s * 10 + c - '0';
    c = getchar();
  }
  return s * t;
}
int main() {
  n = read();
  m = read();
  for (int i = 1; i <= m; i++) a[i] = read(), b[a[i]]++, mx = max(mx, a[i]);
  for (int i = 1; i <= mx; i++)
    if (b[i] > 0) cnt[++tot] = b[i];
  for (int i = 1; i <= m; i++) {
    h = 0;
    for (int j = 1; j <= tot; j++) h += cnt[j] / i;
    if (h >= n)
      ans = i;
    else
      break;
  }
  printf("%d", ans);
  return 0;
}
