#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 10;
int n, k, h[maxn], mx, mn;
long long sum[maxn], cnt[maxn];
int main() {
  scanf("%d", &n);
  scanf("%d", &k);
  mn = maxn;
  for (int i = 1; i <= n; i++)
    scanf("%d", &h[i]), cnt[h[i] + 1]--, mx = max(mx, h[i]), mn = min(mn, h[i]);
  int now = n;
  for (int i = 0; i <= mx; i++) {
    now += cnt[i];
    sum[i] += now;
  }
  for (int i = 1; i <= mx; i++) {
    sum[i] += sum[i - 1];
    cnt[i] += cnt[i - 1];
  }
  int pre = mx, ans = 0;
  for (int h = mx; h >= 1; h--) {
    if (sum[pre] - sum[h - 1] > k || cnt[h] == 0) {
      ans++;
      pre = h;
    }
    if (cnt[h] == 0) break;
  }
  if (mn == mx)
    cout << 0 << endl;
  else
    cout << ans << endl;
  return 0;
}
