#include <bits/stdc++.h>
using namespace std;
int main() {
  int n_columns;
  int n_squares;
  cin >> n_columns >> n_squares;
  int* counter = new int[n_columns];
  for (int i = 0; i < n_columns; i++) {
    counter[i] = 0;
  }
  int tmp;
  for (int i = 0; i < n_squares; i++) {
    cin >> tmp;
    counter[tmp - 1] = counter[tmp - 1] + 1;
  }
  int min = n_squares;
  for (int i = 0; i < n_columns; i++) {
    if (counter[i] < min) min = counter[i];
  }
  cout << min;
}
