#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, m, arr[105], b[102] = {0}, ind = 0;
  cin >> n >> m;
  for (int i = 0; i < m; i++) cin >> arr[i];
  sort(arr, arr + m);
  b[ind] = 1;
  for (int i = 1; i < m; i++) {
    if (arr[i] != arr[i - 1]) {
      ind++;
      b[ind]++;
    } else
      b[ind]++;
  }
  ind++;
  sort(b, b + ind);
  int j = 0;
  for (j = 1; j <= 100; j++) {
    int num = 0;
    for (int i = 0; i < ind; i++) num += b[i] / j;
    if (num < n) break;
  }
  cout << j - 1 << "\n";
  return 0;
}
