#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e9;
const long long inf64 = 1e18;
const long long MOD = inf + 7;
const long long N = 2e5 + 5;
long long f[N], g[N], a[N];
int32_t main() {
  ios::sync_with_stdio(false), cin.tie(nullptr);
  ;
  long long n, k;
  cin >> n >> k;
  long long mn = inf64;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    g[a[i]]++;
    mn = min(mn, a[i]);
  }
  for (long long i = N - 2; i >= 1; i--) {
    f[i] = f[i + 1] + g[i];
  }
  long long ans = 0;
  for (long long i = N - 2; i > mn; i--) {
    long long curcost = 0;
    while (i > mn && curcost + f[i] <= k) {
      curcost += f[i];
      i--;
    }
    if (curcost != 0) i++, ans++;
  }
  cout << ans;
}
