#include <bits/stdc++.h>
using namespace std;
void cline() { cout << '\n'; }
template <typename T, typename... V>
void cline(T t, V... v) {
  cout << t;
  if (sizeof...(v)) cout << ' ';
  cline(v...);
}
void cspc() { cout << ' '; }
template <typename T, typename... V>
void cspc(T t, V... v) {
  cout << t;
  if (sizeof...(v)) cout << ' ';
  cspc(v...);
}
const int N = 2e6 + 4;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, k;
  cin >> n >> k;
  int a[n];
  int min = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] != a[0]) {
      min = 1;
    }
  }
  sort(a, a + n);
  if (min == 0) {
    cout << "0";
    return 0;
  }
  int curk = 0;
  for (int i = a[n - 1]; i >= 1; i--) {
    if (i == a[0]) {
      break;
    }
    int ind = lower_bound(a, a + n, i) - a;
    curk += (n - ind);
    if (curk > k) {
      curk = (n - ind);
      min++;
    }
  }
  cout << min;
  return 0;
}
