#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  long long n, k, ans = 1e9, a;
  cin >> n >> k;
  map<long long, long long> mp;
  for (long long i = 0; i < k; i++) {
    cin >> a;
    mp[a]++;
  }
  for (long long i = 1; i <= n; i++) {
    ans = min(ans, mp[i]);
  }
  cout << ans;
  return 0;
}
