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