#include <bits/stdc++.h>
using namespace std;
const int M = 1000003;
const int N = 100001;
int main() {
  int n, k;
  cin >> n >> k;
  vector<int> v(n);
  for (int i = 0; i < n; ++i) scanf("%d", &v[i]);
  sort(v.rbegin(), v.rend());
  int mx = v[0], mn = v[n - 1];
  vector<int> frq(mx + 1);
  for (int i = 0; i < n; ++i) frq[v[i]]++;
  vector<int> cubesOnH(mx + 1);
  int cub = 0;
  for (int i = mx; i >= mn; --i) {
    cub += frq[i];
    cubesOnH[i] = cub;
  }
  int ans = 0;
  int c = 0;
  for (int i = mx; i > mn; --i) {
    c += cubesOnH[i];
    if (c > k) {
      ans++;
      c = cubesOnH[i];
    }
  }
  cout << ans + (c != 0) << endl;
  return 0;
}
