#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  int a[101] = {0};
  int i = -1;
  while (++i < m) {
    int t;
    cin >> t;
    a[t]++;
  }
  sort(a, a + 101);
  int d = 1;
  i = 101;
  int p = 0;
  while (--i) p += a[i] / d;
  while (p >= n) {
    d++;
    i = 101;
    p = 0;
    while (--i) p += a[i] / d;
  }
  cout << d - 1;
  return 0;
}
