#include <bits/stdc++.h>
using namespace std;
long long ar[200000 + 10];
int main(void) {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n, k;
  cin >> n >> k;
  int i;
  long long h, max_h = 0, min_h = 200000 + 5;
  for (i = 0; i < n; ++i) {
    cin >> h;
    ++ar[h];
    max_h = max(max_h, h);
    min_h = min(min_h, h);
  }
  long long cur = 0, res = 0;
  for (i = max_h; i > min_h; --i) {
    ar[i] += ar[i + 1];
    if (cur + ar[i] > k) {
      ++res;
      cur = 0;
    }
    cur += ar[i];
  }
  cout << res + (cur != 0);
  return 0;
}
