#include <bits/stdc++.h>
using namespace std;
const int N = 200005;
int a[N + 1], pref[N + 1];
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  int n, k, ans = 0, mn = 2e9, cur = 0;
  cin >> n >> k;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    mn = min(mn, a[i]);
    pref[1]++;
    pref[a[i] + 1]--;
  }
  for (int i = 1; i <= N; i++) {
    pref[i] = pref[i - 1] + pref[i];
  }
  int i = N;
  while (i > mn) {
    cur += pref[i];
    if (cur > k) {
      ans++;
      cur = pref[i];
    }
    i--;
  }
  if (cur == 0) {
    cout << "0\n";
    return 0;
  }
  cout << ans + 1 << "\n";
  return 0;
}
