#include <bits/stdc++.h>
using namespace std;
const int N = 200100;
long long n, k, cum[N], mx, mn = 1e9, curr, ans, pos = -1;
int main() {
  scanf("%lld%lld", &n, &k);
  for (int i = 0; i < n; i++) {
    long long x;
    scanf("%lld", &x);
    mn = min(mn, x);
    mx = max(mx, x);
    cum[x]++;
  }
  for (int i = mx; i >= mn; i--) cum[i] += cum[i + 1];
  for (int i = mx; i > mn; i--) {
    if (curr + cum[i] <= k)
      curr += cum[i];
    else {
      pos = i;
      ans++;
      curr = cum[i];
    }
  }
  if (curr > 0 && pos != mn) ans++;
  printf("%lld", ans);
}
