#include <bits/stdc++.h>
using namespace std;
const int N = 3e5;
int n, a[N], c[N];
long long k;
int main() {
  scanf("%d %lld", &n, &k);
  int mn = 1e9, H = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    c[a[i]]++;
    mn = min(mn, a[i]);
    H = max(H, a[i]);
  }
  int ans = 0, cnt = 0;
  while (H > mn) {
    long long t = 0;
    while (t < k && H > mn) {
      if (cnt + c[H] > k - t) break;
      cnt += c[H];
      t += cnt;
      H--;
    }
    ans++;
  }
  printf("%d\n", ans);
}
