#include <bits/stdc++.h>
using namespace std;
long long a[200005];
long long b[200005];
int main(void) {
  ios::sync_with_stdio(false);
  long long n, k;
  cin >> n >> k;
  long long mx = -0x3f3f3f3f, mn = 0x3f3f3f3f;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i];
    b[a[i]]++;
    mx = max(mx, a[i]);
    mn = min(mn, a[i]);
  }
  for (int i = mx; i >= 1; --i) b[i] += b[i + 1];
  long long ans = 0, now = 0;
  for (int i = mx; i > mn; --i) {
    if (now + b[i] > k) {
      ans++;
      now = 0;
    }
    now += b[i];
  }
  if (now) ans++;
  cout << ans << endl;
  return 0;
}
