#include <bits/stdc++.h>
int main() {
  int i, j, tmp = 0;
  int N, x;
  static int a[100000000];
  int c = 0;
  int r = 0;
  if (scanf("%d%d", &N, &x) == 1)
    ;
  if (N < 2 || 100 < N) {
    printf("error");
    return (0);
  }
  if (x < 1 || 1000000000 < x) {
    printf("error");
    return (0);
  }
  for (i = 0; i < N; i++) {
    if (scanf("%d", &a[i]) == 1)
      ;
    if (a[i] < 1 || 1000000000 < a[i]) {
      printf("error");
      return (0);
    }
  }
  for (i = 0; i < N; ++i) {
    for (j = i + 1; j < N; ++j) {
      if (a[i] > a[j]) {
        tmp = a[i];
        a[i] = a[j];
        a[j] = tmp;
      }
    }
  }
  i = 0;
  j = 0;
  while (r < x) {
    r = r + 1;
    j = j + 1;
    if (j == a[i]) {
      i = i + 1;
      j = 0;
      if (i == N) {
        r = x + 1;
      }
    }
  }
  if (r == x + 1) {
    printf("%d\n", N);
  } else {
    printf("%d\n", i);
  }
  return (0);
}
