#include <bits/stdc++.h>
using namespace std;
int n, m;
int a[200], b[200];
int check(int n, int d, int a[]) {
  for (int i = 1; i <= n; ++i) {
    int flag = 0;
    for (int v = 1; v <= 100; ++v)
      if (a[v] >= d) {
        a[v] -= d;
        flag = 1;
        break;
      }
    if (flag == 0) return 0;
  }
  return 1;
}
int main() {
  cin >> n >> m;
  for (int i = 0; i < m; ++i) {
    cin >> b[i];
  }
  int ans = 0;
  int l = 1, r = m;
  while (l <= r) {
    memset(a, 0, sizeof(a));
    for (int i = 0; i < m; ++i) a[b[i]]++;
    int k = (l + r) / 2;
    if (check(n, k, a)) {
      ans = max(ans, k);
      l = k + 1;
    } else
      r = k - 1;
  }
  memset(a, 0, sizeof(a));
  for (int i = 0; i < m; ++i) a[b[i]]++;
  if (check(n, l, a)) ans = max(ans, l);
  memset(a, 0, sizeof(a));
  for (int i = 0; i < m; ++i) a[b[i]]++;
  if (check(n, r, a)) ans = max(ans, r);
  cout << ans << endl;
  return 0;
}
