#include <bits/stdc++.h>
inline int readin() {
  int x = 0, c;
  for (; (c = getchar()) < '0' || c > '9';)
    ;
  for (; c >= '0' && c <= '9'; c = getchar()) x = (x << 1) + (x << 3) + c - 48;
  return x;
}
int a[200005];
bool cmp(int x, int y) { return x > y; }
int main() {
  int n = readin(), k = readin();
  for (int i = 1; i <= n; i++) a[i] = readin();
  std::sort(a + 1, a + 1 + n, cmp);
  a[n + 1] = a[n];
  long long l = 0, tot = 0, h = a[1];
  int ans = 0;
  while (l != n) {
    ++l;
    while (l < n && a[l] == a[l + 1]) ++l;
    while (h > a[l + 1]) {
      long long tmp = k - tot;
      tmp /= l;
      h -= tmp;
      if (h <= a[l + 1])
        tot += (tmp + h - a[l + 1]) * 1ll * l, h = a[l + 1];
      else
        tot = 0, ans++;
    }
  }
  if (tot) ans++;
  printf("%d", ans);
}
