#include <bits/stdc++.h>
using namespace std;
int hCount[200005];
long long n, k;
long long minH, maxH;
int main() {
  while (cin >> n >> k) {
    memset(hCount, 0, sizeof(hCount));
    long long tmp;
    minH = INT_MAX;
    maxH = 0;
    for (int i = 0; i < n; i++) {
      cin >> tmp;
      hCount[tmp]++;
      minH = min(minH, tmp);
      maxH = max(maxH, tmp);
    }
    long long curS = 0, curC = 0;
    long long res = 0;
    for (int i = maxH; i > minH; i--) {
      curC += hCount[i];
      if (curS + curC > k) {
        res++, curS = 0;
      }
      curS += curC;
    }
    if (curS) res++;
    cout << res << endl;
  }
  return 0;
}
