#include <bits/stdc++.h>
using namespace std;
long long z[200005];
long long h[200005];
int main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL);
  long long n = 0, k = 0;
  cin >> n >> k;
  vector<long long> v;
  long long mn = 999999999999999;
  long long mx = -999999999999999;
  for (long long i = 0; i < n; i++) {
    long long x;
    cin >> x;
    v.push_back(x);
    mn = min(mn, x);
    mx = max(mx, x);
  }
  if (mx == mn) {
    cout << "0";
    return 0;
  }
  for (auto u : v) {
    if (u >= mn) {
      z[mn]++;
      z[u]--;
    }
  }
  long long cnt = 0;
  for (long long i = mn; i < mx + 1; i++) {
    cnt += z[i];
    h[i] = cnt;
  }
  long long res = 0;
  long long c = 0;
  for (long long i = mx; i >= mn; i--) {
    c += h[i];
    if (c > k) {
      i++;
      res++;
      c = 0;
    }
  }
  cout << res + 1;
  return 0;
}
