#include <bits/stdc++.h>
using namespace std;
long long n, k, a, bucket[200010];
int main() {
  cin >> n >> k;
  for (long long i = 0; i < n; i++) {
    cin >> a;
    bucket[a]++;
  }
  long long cuts = 0;
  long long blocks = 0;
  for (long long i = 200010 - 5; i > 0; i--) {
    bucket[i] += bucket[i + 1];
    if (blocks + bucket[i] > k || bucket[i] == n) {
      if (blocks > 0) cuts++;
      blocks = 0;
      if (bucket[i] == n) break;
    }
    blocks += bucket[i];
  }
  cout << cuts << endl;
  return 0;
}
