#include <bits/stdc++.h>
using namespace std;
long long i, j, k, l, n, q, m, d, su, sx, sy,
    prod = 1, ans, maxi, a, b, x, y, o, e, f, mini = 10000000000000, t, cnt;
string s;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int ti = 1;
  while (ti--) {
    map<long long, long long> ma;
    cin >> n >> k;
    for (int i = 0; i < n; i++) {
      cin >> x;
      maxi = max(maxi, x);
      mini = min(mini, x);
      ma[x]++;
    }
    if (maxi == mini)
      cout << "0";
    else {
      long long last = 0;
      for (int itr = maxi; itr >= mini; itr--) {
        ma[itr] += last;
        last = ma[itr];
      }
      long long sum = 0;
      for (int i = maxi; i >= mini + 1; i--) {
        sum += ma[i];
        if (sum > k) {
          ans++;
          sum = ma[i];
        }
      }
      cout << ans + 1;
    }
  }
  return 0;
}
