#include <bits/stdc++.h>
using namespace std;
template <class T>
using V = vector<T>;
template <class T, class U>
using M = unordered_map<T, U>;
using F = double;
using S = string;
using ll = long long;
using vi = V<int>;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  vi a(n, 0);
  for (int i = 0; i < m; i++) {
    int c;
    cin >> c;
    a[c - 1]++;
  }
  cout << (*min_element(a.begin(), a.end())) << '\n';
}
