#include <bits/stdc++.h>
using namespace std;
long long c[200010];
int mn = 300000, mx, n, k, a[200010], s[200010], top, ans;
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    s[a[i]]++;
    mn = min(mn, a[i]);
    mx = max(mx, a[i]);
  }
  for (int i = mx; i >= 1; i--) s[i] += s[i + 1];
  top = mx;
  while (top > mn) {
    long long tot = 0;
    while (tot + s[top] <= k && top >= mn) {
      tot += s[top--];
    }
    ans++;
  }
  printf("%d\n", ans);
  return 0;
}
