#include <bits/stdc++.h>
#pragma GCC optimize(3)
using namespace std;
long long n, k, h[200005], sum[200005], cnt[200005];
int main() {
  scanf("%lld%lld", &n, &k);
  long long minx = 1000000000, mx = 0;
  for (long long i = 1; i <= n; i++) {
    scanf("%lld", &h[i]);
    minx = min(minx, h[i]);
    mx = max(mx, h[i]);
    cnt[h[i]]++;
  }
  long long now = 0;
  for (long long i = 200000; i >= 1; i--) {
    now += cnt[i];
    sum[i] = sum[i + 1] + now;
  }
  long long cur = mx, ans = 0;
  while (cur > minx) {
    long long l = 1, r = cur;
    while (r - l > 1) {
      long long mid = (l + r) / 2;
      if (sum[cur - mid + 1] - sum[cur + 1] <= k)
        l = mid;
      else
        r = mid;
    }
    cur -= l;
    ans++;
  }
  printf("%lld\n", ans);
  return 0;
}
