#include <bits/stdc++.h>
using namespace std;
int n, k, h[200005], f[200005], s[200005];
void Code() {
  cin >> n >> k;
  for (int i = 1; i <= n; i++) {
    cin >> h[i];
    f[h[i] - 1]++;
  }
  bool check = false;
  for (int i = 2; i <= n; i++)
    if (h[i] != h[i - 1]) {
      check = true;
      break;
    }
  if (check == false) {
    cout << 0;
    return;
  }
  for (int i = 2e5; i >= 0; i--) {
    f[i] += f[i + 1];
    s[i] = s[i + 1] + f[i];
  }
  int pre = 2e5, res = 0;
  while (1) {
    res++;
    int tmp = pre;
    while (tmp > 0 && s[tmp - 1] - s[pre] <= k) tmp--;
    if (tmp == 0 || f[tmp - 1] == n) break;
    pre = tmp;
  }
  cout << res;
}
int main() {
  ios_base::sync_with_stdio(false);
  Code();
}
