#include <bits/stdc++.h>
using namespace std;
long long a[200011];
long long vis[200010] = {0};
int main() {
  int n, k, i, ans = 0;
  long long minx = 200010, maxx = 0;
  long long S = 0;
  cin >> n >> k;
  for (i = 0; i < n; i++) {
    cin >> a[i];
    vis[a[i]]++;
    minx = min(minx, a[i]);
    maxx = max(maxx, a[i]);
  }
  for (i = maxx; i > minx; i--) vis[i - 1] += vis[i];
  int l = maxx;
  long long sum = 0;
  while (l > minx) {
    if (sum + vis[l] < k) {
      sum += vis[l];
      l--;
    } else if (vis[l] + sum > k) {
      ans++;
      sum = 0;
    } else {
      ans++;
      sum = 0;
      l--;
    }
  }
  if (sum != 0) ans++;
  cout << ans << endl;
}
