#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
long long n, m;
void solve() {
  long long n, k;
  cin >> n >> k;
  long long mx = 0;
  long long mn = 1000000;
  vector<long long> a(n);
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    mx = max(mx, a[i]);
    mn = min(mn, a[i]);
  }
  vector<long long> b(200005, 0);
  for (long long i = 0; i < n; i++) {
    long long cur = a[i];
    b[1]++;
    b[cur + 1]--;
  }
  for (long long i = 2; i < mx + 2; i++) b[i] += b[i - 1];
  long long cur = mx, sum = 0, slice = 0;
  while (cur > mn) {
    sum += b[cur];
    if (sum + b[cur - 1] > k || cur == mn + 1) {
      sum = 0;
      slice++;
    }
    cur--;
  }
  cout << slice;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  while (t--) {
    solve();
    cout << endl;
  }
}
