#include <bits/stdc++.h>
using namespace std;
bool flag = true;
const long long int N = 2e5 + 5;
const long long int inf = 998244353;
void solve() {
  long long int i = 0, j = 0, ans = 0, x = 0, y = 0, z = 0;
  long long int n, k = 0, m = 0, mn = LLONG_MAX, mx = LLONG_MIN;
  cin >> n >> k;
  vector<long long int> a(n), v;
  for (auto &it : a) {
    cin >> it;
    mx = max(mx, it);
    mn = min(mn, it);
  }
  if (mx == mn) {
    cout << "0";
    return;
  }
  sort(a.begin(), a.end());
  for (i = mx; i >= mn; i--) {
    j = upper_bound(a.begin(), a.end(), i) - a.begin();
    v.push_back(n - j);
  }
  x = 0;
  ans = 1;
  for (i = 0; i < (long long int)v.size(); i++) {
    if (x + v[i] <= k)
      x += v[i];
    else {
      ans++;
      x = v[i];
    }
  }
  cout << ans << endl;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  ;
  long long int T = 1, te = 1;
  while (T--) {
    solve();
  }
  return 0;
}
