#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 10;
long long a[MAXN];
int main() {
  int n;
  long long k;
  cin >> n >> k;
  int now = 0;
  for (int i = 1; i <= n; i++) {
    int x;
    cin >> x;
    now = max(now, x);
    a[x]++;
  }
  for (int i = 200000; i >= 1; i--) {
    a[i] += a[i + 1];
  }
  for (int i = 1; i <= 200000; i++) {
    a[i] += a[i - 1];
  }
  long long w = 0;
  long long ans = 0;
  while (1) {
    if (a[now] == 1LL * now * n) {
      break;
    }
    ans++;
    while (w + (a[now] - a[now - 1]) <= k) {
      w += (a[now] - a[now - 1]);
      now--;
      if (a[now] == 1LL * now * n) {
        break;
      }
    }
    w = 0;
  }
  cout << ans << endl;
  return 0;
}
