#include <bits/stdc++.h>
using namespace std;
inline void read(int &x) {
  char ch;
  bool flag = false;
  for (ch = getchar(); !isdigit(ch); ch = getchar())
    if (ch == '-') flag = true;
  for (x = 0; isdigit(ch); x = x * 10 + ch - '0', ch = getchar())
    ;
  x = flag ? -x : x;
}
const long long P = 1e9 + 7;
int a[200005], b[200005];
int main() {
  int n, k;
  cin >> n >> k;
  int minl = 1e9, maxl = -1;
  for (int i = 1; i <= n; i++) {
    read(a[i]);
    b[a[i]]++;
    minl = min(minl, a[i]);
    maxl = max(maxl, a[i]);
  }
  if (maxl == minl) {
    cout << 0 << endl;
    return 0;
  }
  int ans = 0, sum = 0, p = 0;
  ;
  for (int i = maxl; i >= minl; i--) {
    sum += p;
    p += b[i];
    sum += b[i];
    if (sum > k || i == minl) {
      ans++;
      sum = p;
    }
  }
  cout << ans << endl;
  return 0;
}
