#include <bits/stdc++.h>
using namespace std;
int n, k, a[200000], freq[200001];
int main() {
  cin >> n >> k;
  int mn = 1e9, mx = 0;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    ++freq[a[i]];
    mn = min(mn, a[i]);
    mx = max(mx, a[i]);
  }
  long long ans = 0;
  for (int i = mx; i > mn;) {
    int u = freq[i];
    --i;
    --mx;
    freq[mx] += freq[mx + 1];
    while (u + freq[mx] <= k && mx > mn) {
      u += freq[mx];
      --mx;
      --i;
      freq[mx] += freq[mx + 1];
    }
    ans++;
  }
  cout << ans;
  return 0;
}
