#include <bits/stdc++.h>
using namespace std;
const int maxm = 200005;
int n, k;
int a[maxm];
int cmp(int x, int y) { return x > y; }
long long s[maxm], f[maxm];
int main() {
  int i, j, sum, t, ans, tmp = 3000000, now;
  scanf("%d%d", &n, &k);
  for (i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    tmp = min(tmp, a[i]);
  }
  sort(a + 1, a + 1 + n, cmp);
  if (a[1] == tmp) {
    printf("0\n");
    return 0;
  }
  now = a[1];
  ans = 0;
  s[a[1]] = 0, f[a[1]] = 1;
  for (i = 2; i <= n; i++) {
    if (a[i] == a[i - 1]) continue;
    for (j = a[i - 1] - 1; j >= a[i]; j--) {
      s[j] = s[j + 1] + (i - 1);
      f[j] = f[j + 1];
      if (s[j] > k) {
        f[j] = f[j + 1] + 1;
        s[j] = i - 1;
      }
    }
  }
  printf("%d\n", f[a[n]]);
  return 0;
}
