#include <bits/stdc++.h>
using namespace std;
int arr[200002];
long long arr2[200002];
long long level[200002];
int main() {
  long long n, k;
  cin >> n >> k;
  int m = 2e6;
  int mm = 0;
  for (int i = 0; i < n; ++i) {
    cin >> arr[i];
    m = min(arr[i], m);
    mm = max(arr[i], mm);
  }
  sort(arr, arr + n);
  arr2[0] = arr[0];
  for (int i = 1; i < n; ++i) {
    arr2[i] = arr[i] + arr2[i - 1];
  }
  bool x = true;
  for (int i = 0; i < n; ++i) {
    if (arr[i] != m) {
      x = false;
      break;
    }
  }
  if (x) {
    cout << 0 << endl;
    return 0;
  }
  int l;
  for (int i = mm - 1; i >= m; --i) {
    l = upper_bound(arr, arr + n, i) - arr;
    long long sum = arr2[n - 1] - arr2[l - 1];
    level[i] = sum - (i * 1ll * (n - l));
  }
  long long ans = 0;
  int h = k;
  for (int i = mm; i > m; --i) {
    if (level[i - 1] > k) {
      ans++;
      k = h + level[i];
    }
  }
  cout << ans + 1 << endl;
}
