#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  int columns[n + 1];
  memset(columns, 0, sizeof(columns));
  for (int i = 0; i < m; i++) {
    int tmp;
    cin >> tmp;
    columns[tmp]++;
  }
  int ans = 1001;
  for (int i = 1; i <= n; i++) {
    ans = min(ans, columns[i]);
  }
  cout << ans << endl;
  return 0;
}
