#include <bits/stdc++.h>
using namespace std;
int criteriu(int a, int b) {
  if (a > b) return 1;
  return 0;
}
long long int ctprev, sumprev, posnew, pos, n, k, i, a[200005], ct,
    minim = 999999999, sum, iprev, sl, posprev;
int main() {
  cin >> n >> k;
  for (i = 1; i <= n; ++i) {
    scanf("%I64d", &a[i]);
  }
  sort(a + 1, a + n + 1, criteriu);
  for (; a[n] == a[n - 1]; --n)
    ;
  a[0] = a[1];
  for (i = a[1], pos = 1; i > a[n]; --i) {
    posprev = pos;
    ctprev = ct;
    while (a[pos] == i) {
      ++pos;
      ++ct;
      sum += a[pos - 1];
    }
    if (sum - ct * (i - 1) > k) {
      ++sl;
      sum = ctprev * i;
      ct = ctprev;
      pos = posprev;
      ++i;
    }
  }
  if (sum > 0) ++sl;
  cout << sl << '\n';
  return 0;
}
