#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long k, n;
  cin >> n >> k;
  vector<long long> ar(n);
  for (long long i = 0; i < n; i++) cin >> ar[i];
  long long Min = *min_element(ar.begin(), ar.end());
  for (long long i = 0; i < n; i++) ar[i] -= Min;
  long long Max = *max_element(ar.begin(), ar.end());
  vector<long long> level(Max + 1, 0);
  for (long long i = 0; i < n; i++) {
    level[0]++;
    level[ar[i]]--;
  }
  for (long long i = 1; i < Max + 1; i++) {
    level[i] += level[i - 1];
  }
  long long cont = 0, sum = 0, a = Max;
  while (a >= 0) {
    sum += level[a];
    if (sum == k) {
      cont++;
      sum = 0;
    } else if (sum > k) {
      cont++;
      sum = 0;
      a++;
    }
    a--;
  }
  if (sum != 0) cont++;
  cout << cont;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long q = 1;
  while (q--) {
    solve();
  }
  return 0;
}
