#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  map<int, int> br;
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    br[a]++;
  }
  int broj = 0;
  for (int i = 200001; i >= 0; i--) {
    int d = br[i];
    if (d == 0) continue;
    if (d == n) {
      break;
    }
    int kk = k;
    while (kk - br[i] >= 0) {
      if (br[i] == n || i < 0) {
        break;
      }
      kk -= br[i];
      br[i - 1] += br[i];
      br[i] = 0;
      i--;
    }
    i++;
    broj++;
  }
  cout << broj << endl;
  return 0;
}
