#include <bits/stdc++.h>
using namespace std;
int n, m, c, a[1000];
int main() {
  scanf("%d%d", &n, &m);
  while (m) {
    scanf("%d", &c);
    a[--c]++;
    m--;
  }
  cout << *min_element(a, a + n);
  return 0;
}
