#include <bits/stdc++.h>
const int MAXN = 100005;
const double eps = 1e-8;
const double PI = acos(-1.0);
using namespace std;
long long n, k, sum, tmp;
long long a[200005], b[200005];
int main() {
  while (scanf("%lld%lld", &n, &k) != EOF) {
    long long mina = 0x3f3f3f3f, maxa = -1, mm = 0x3f3f3f3f;
    sum = 0, tmp = 0;
    for (int i = 0; i < n; ++i) {
      scanf("%lld", &a[i]);
      mina = min(a[i], mina);
    }
    for (int i = 0; i < n; ++i) {
      a[i] -= mina;
      maxa = max(maxa, a[i]);
      mm = min(mm, a[i]);
      b[a[i]]++;
    }
    for (int i = maxa - 1; i >= 1; --i) {
      b[i] += b[i + 1];
    }
    for (int i = maxa; i >= 1; --i) {
      if (tmp + b[i] > k) {
        tmp = b[i];
        sum++;
      } else {
        tmp += b[i];
      }
    }
    if (mm == maxa) {
      cout << "0" << endl;
      return 0;
    }
    cout << sum + 1 << endl;
  }
  return 0;
}
