#include <bits/stdc++.h>
using namespace std;
const int maxn = 200005;
int n, k, h[maxn], maxx, minn = 1e9, sum[maxn], cnt[maxn], ans, s;
int main() {
  cin >> n >> k;
  for (int i = 1; i <= n; i++) {
    cin >> h[i];
    maxx = max(maxx, h[i]);
    minn = min(minn, h[i]);
    cnt[h[i]]++;
  }
  for (int i = maxx; i > minn; i--) cnt[i] += cnt[i + 1];
  for (int i = maxx; i > minn; i--) {
    s += cnt[i];
    if (s > k) s = cnt[i], ans++;
  }
  if (s) ans++;
  cout << ans;
  return 0;
}
