#include <bits/stdc++.h>
using namespace std;
int b[1005];
int n, m;
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; i++) {
    int x;
    scanf("%d", &x);
    b[x]++;
  }
  int minn = 2000;
  for (int i = 1; i <= n; i++) minn = min(minn, b[i]);
  printf("%d", minn);
  return 0;
}
