#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 4;
int height[N], n, k;
int mx, mn = INT_MAX;
void read() {
  cin >> n >> k;
  for (int i = 0; i < n; ++i) {
    int x;
    cin >> x;
    ++height[x];
    mx = max(mx, x);
    mn = min(mn, x);
  }
}
void precalc() {
  for (int i = mx - 1; i >= 1; --i) {
    height[i] += height[i + 1];
  }
}
void solve() {
  if (mx == mn) {
    cout << 0;
    return;
  }
  int it = mn + 1, cnt = 1;
  long long sum = 0;
  for (int i = mn + 1; i <= mx; ++i) {
    sum += (long long)height[i];
    if (sum > k) {
      ++cnt;
      sum = height[i];
    }
  }
  cout << cnt;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  read();
  precalc();
  solve();
  return 0;
}
