#include <bits/stdc++.h>
using namespace std;
const int maxn = 2 * 1e5 + 5;
int A[maxn];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  long long k;
  cin >> n;
  cin >> k;
  int c = 0;
  int h = (1 << 30);
  for (int i = 1; i <= n; i++) {
    cin >> A[i];
    h = min(h, A[i]);
  }
  stable_sort(A + 1, A + 1 + n);
  int pos = n;
  int sol = 0;
  int H = A[n];
  long long cost = 0;
  while (H > h) {
    int pos = lower_bound(A + 1, A + 1 + n, H) - A;
    long long tcost = (n - pos + 1);
    if (cost + tcost > k) {
      sol++;
      cost = tcost;
    } else
      cost += tcost;
    H--;
  }
  if (cost > 0) sol++;
  cout << sol;
  return 0;
}
