#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
int n, a[100100], m, x, rs = 1e9;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  for (int i = 1; i <= m; i++) cin >> x, a[x]++;
  for (int i = 1; i <= n; i++) rs = min(rs, a[i]);
  cout << rs;
  return 0;
}
