#include <bits/stdc++.h>
using namespace std;
int n, k;
int f[200010];
int h[200010];
int main() {
  cin >> n >> k;
  int mx = 0;
  for (int i = 0; i < n; i++) {
    cin >> h[i];
    mx = max(mx, h[i]);
  }
  sort(h, h + n);
  int j = n - 1;
  int cnt = 0;
  for (int i = mx; i > 0; i--) {
    while (h[j] >= i && j > -1) {
      cnt++;
      j--;
    }
    f[i] += cnt;
  }
  int cur = 0;
  int ans = 0;
  for (int i = mx; i >= 0; i--) {
    if (f[i] >= n) {
      ans += (cur > 0);
      break;
    }
    cur += f[i];
    if (cur > k) {
      ans++;
      cur = f[i];
    }
  }
  cout << ans << endl;
  return 0;
}
