#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, low = 200000;
  cin >> n >> k;
  int cnt[200005]{};
  for (int i = 0; i < n; ++i) {
    int x;
    cin >> x;
    ++cnt[x], low = min(low, x);
  }
  int ans = 0, tmp = 0, now = 0;
  for (int i = 200000; i > low; --i) {
    tmp += cnt[i];
    if (now + tmp > k) now = 0, ++ans;
    now += tmp;
  }
  if (now > 0) ++ans;
  cout << ans;
}
