#include <bits/stdc++.h>
#pragma optimize("", off)
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma comment(linker, "/STACK:36777216")
using namespace std;
template <class T>
void smin(T& a, T val) {
  if (a > val) a = val;
}
template <class T>
void smax(T& a, T val) {
  if (a < val) a = val;
}
template <typename T>
inline std::ostream& operator<<(std::ostream& os, const std::vector<T>& v) {
  bool first = true;
  os << "[";
  for (auto i : v) {
    if (!first) os << ", ";
    os << i;
    first = false;
  }
  return os << "]";
}
const int N = 2 * 1e5 + 10;
int a[N], n, b[N], m;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n >> m;
  for (int i = 1; i <= m; ++i) {
    int x;
    cin >> x;
    a[x]++;
  }
  if (m < n) {
    cout << 0;
    return 0;
  }
  for (int i = 1; i <= 100; ++i) {
    b[i] = a[i];
  }
  sort(b + 1, b + 101);
  int l = 0, ans;
  for (int i = 1; i <= 100; ++i) {
    ans = 0;
    for (int j = 100; j >= 100 - n + 1 and j >= 1; --j) {
      if (b[j] / i > 0) ans += b[j] / i;
    }
    if (ans >= n) smax(l, i);
  }
  cout << l;
  return 0;
}
