#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,sse3,sse4,popcnt,abm,mmx")
using namespace std;
inline bool isvowel(char c) {
  c = tolower(c);
  if (c == 'a' || c == 'e' || c == 'i' || c == 'y' || c == 'o' || c == 'u')
    return 1;
  return 0;
}
const double eps = 0.000001;
const long double pi = acos(-1);
const int maxn = 1e7 + 9;
const int mod = 1e9 + 7;
const long long MOD = 1e18 + 9;
const long long INF = 1e18 + 123;
const int inf = 2e9 + 11;
const int mxn = 1e6 + 9;
const int N = 3e5 + 123;
const int PRI = 555557;
const int pri = 997;
const int Magic = 2101;
inline void randomizer3000() {
  unsigned int seed;
  asm("rdtsc" : "=A"(seed));
  srand(seed);
}
int n, m, k;
int a[N];
int cnt[N];
int eat[N];
int main() {
  cin >> n >> m;
  for (long long i = 1; i <= m; i++) {
    cin >> a[i];
    cnt[a[i]]++;
  }
  if (n > m) {
    cout << 0;
    exit(0);
  }
  int mn = inf;
  while (n--) {
    int cur = 0, now = 0;
    for (int i = 1; i <= 100; i++) {
      now = cnt[i] / (eat[i] + 1);
      cur = max(cur, now);
    }
    for (int i = 1; i <= 100; i++) {
      now = cnt[i] / (eat[i] + 1);
      if (cur == now) {
        eat[i]++;
        break;
      }
    }
    mn = min(mn, cur);
  }
  cout << mn;
  return 0;
}
