#include <bits/stdc++.h>
int main() {
  int t, n;
  scanf("%d%d", &n, &t);
  int b[10000], a[10000];
  for (int i = 0; i < t; i++) {
    scanf("%d", &a[i]);
  }
  for (int i = 1; i <= n; i++) {
    int k = 0, cnt = 0;
    for (int j = 0; j < t; j++) {
      if (a[j] == i) {
        cnt++;
      }
    }
    b[i - 1] = cnt;
  }
  int min = b[0];
  for (int i = 0; i < n; i++) {
    if (b[i] < min) {
      min = b[i];
    }
  }
  printf("%d", min);
}
