#include <bits/stdc++.h>
using namespace std;
long long larg = pow(10, 9) + 7;
vector<long long> visited;
void dfs(vector<vector<long long>>& adj, long long i) {
  visited[i] = true;
  for (long long j = 0; j < adj[i].size(); j++) {
    if (!visited[adj[i][j]]) dfs(adj, adj[i][j]);
  }
}
void solve() {
  long long n, k, i;
  cin >> n >> k;
  long long arr[n];
  long long pre[n];
  for (i = 0; i < n; i++) cin >> arr[i];
  bool no = true;
  sort(arr, arr + n, greater<long long>());
  pre[0] = arr[0];
  for (i = 1; i < n; i++) {
    pre[i] = pre[i - 1] + arr[i];
    if (arr[i] != arr[i - 1]) no = false;
  }
  if (no == true) {
    cout << "0";
    return;
  }
  long long h = arr[0] - 1;
  long long j = 1;
  long long prev = 0;
  long long x, ans = 0;
  long long lastx = 0;
  while (h >= arr[n - 1]) {
    while ((j < n) && arr[j] >= h) j++;
    x = pre[j - 1] - j * h;
    if ((x - prev) > k) {
      ans++;
      prev = lastx;
    }
    lastx = x;
    h--;
  }
  ans++;
  cout << ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t;
  t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
