#include <bits/stdc++.h>
using namespace std;
int h[200000];
int cost[200000];
int main() {
  int n, k;
  int slice = 0;
  int M = 1, m = 200000;
  cin >> n >> k;
  for (int i = 0; i < n; ++i) {
    cin >> h[i];
    M = max(M, h[i]);
    m = min(m, h[i]);
  }
  sort(begin(h), begin(h) + n);
  int cur = m;
  for (int i = 0; i < n; ++i) {
    if (h[i] > cur) {
      cost[h[i] - 1] = n - i;
      cur = h[i];
    }
  }
  for (int i = M - 1; i >= m; --i) {
    if (cost[i] == 0) {
      cost[i] = cost[i + 1];
    }
  }
  int cnt = 0;
  for (int i = m; i < M; ++i) {
    cnt += cost[i];
    if (cnt + cost[i + 1] > k) {
      slice++;
      cnt = 0;
    }
  }
  if (cnt) slice++;
  cout << slice << endl;
  return 0;
}
