#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  vector<int> V(n);
  for (int i = 0; i < m; ++i) {
    int k;
    cin >> k;
    V[k - 1]++;
  }
  int mn = 1e9;
  for (int i = 0; i < n; ++i) mn = min(mn, V[i]);
  cout << mn << "\n";
  return 0;
}
