#include <bits/stdc++.h>
using namespace std;
int h[200004], cnt[200004], n, k;
int w33ha() {
  int ans = 1;
  memset(cnt, 0, sizeof(cnt));
  for (int i = 1; i <= n; i++) {
    scanf("%d", &h[i]);
    cnt[h[i]]++;
  }
  sort(h + 1, h + n + 1);
  int ops = n, H = h[1], cop = 0;
  ops -= cnt[H];
  while (H <= h[n]) {
    if (ops + cop > k) {
      cop = 0;
      ans++;
    }
    ++H;
    cop += ops;
    ops -= cnt[H];
  }
  if (h[1] == h[n])
    puts("0");
  else
    printf("%d\n", ans);
  return 0;
}
int main() {
  while (scanf("%d%d", &n, &k) != EOF) w33ha();
  return 0;
}
