#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 1;
int ar[MAXN] = {}, b[MAXN] = {};
void solve() {
  long long n, k;
  cin >> n >> k;
  for (int i = 0; i < n; ++i) {
    cin >> ar[i];
  }
  sort(ar, ar + n);
  reverse(ar, ar + n);
  int t = ar[0];
  while (t > ar[n - 1]) {
    int i = -1, j = n;
    while (j - i > 1) {
      long long q = (i + j) / 2;
      if (ar[q] >= t) {
        i = q;
      } else {
        j = q;
      }
    }
    if (ar[i] >= t) {
      b[t] = i + 1;
    }
    --t;
  }
  t = ar[0];
  long long ans = 0;
  while (t > ar[n - 1]) {
    int cur = 0;
    while (t > ar[n - 1] && cur + b[t] <= k) {
      cur += b[t];
      --t;
    }
    if (cur > 0) ++ans;
  }
  cout << ans << '\n';
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  solve();
  return 0;
}
