#include <bits/stdc++.h>
using namespace std;
map<long long, long long> mapa;
int main() {
  long long n, m, sol = 4878343432234, a;
  cin >> n >> m;
  for (long i = 0; i < m; i++) {
    cin >> a;
    mapa[a]++;
  }
  for (long i = 1; i <= n; i++) {
    sol = min(sol, mapa[i]);
  }
  cout << sol << endl;
}
