#include <bits/stdc++.h>
using namespace std;
long long a[300000];
long long b[300000];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n, k, i;
  cin >> n >> k;
  long long ma = -1;
  long long mi = 1e10;
  for (i = 1; i <= n; i++) {
    cin >> a[i];
    b[a[i]]++;
    ma = max(ma, a[i]);
    mi = min(mi, a[i]);
  }
  for (i = ma; i >= mi; i--) b[i] += b[i + 1];
  for (i = ma; i >= mi; i--) b[i] += b[i + 1];
  long long ans = 0;
  long long sub = 0;
  for (i = ma; i >= mi; i--) {
    if (b[i] - sub > k || (i == mi && (b[i] - sub > n))) {
      ans++;
      sub += b[i + 1] - sub;
    }
  }
  cout << ans;
  return 0;
}
