#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
const long double EPS = (1e-7);
const long long OO = 1e9;
const long long mod = 1e9 + 7;
int dcmp(long double x, long double y) {
  return fabs(x - y) <= EPS ? 0 : x < y ? -1 : 1;
}
int dx[] = {0, 0, 1, -1, 1, 1, -1, -1};
int dy[] = {1, -1, 0, 0, -1, 1, 1, -1};
void fast() {
  std::ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
}
const int MAX = 5 * 100 * 1000 + 5;
long long n, k;
int frq[MAX];
int main() {
  fast();
  int mn = OO;
  cin >> n >> k;
  int mm = 0;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    mn = min(x, mn);
    mm = max(mm, x);
    frq[x]++;
  }
  if (mm == mn) {
    cout << 0 << endl;
    return 0;
  }
  int cnt = 0;
  long long p = 0, sum = 0;
  for (int i = MAX - 2; i >= mn; i--) {
    int w = (p + frq[i + 1]);
    if (sum + w <= k) {
      sum += w;
      p = w;
    } else {
      cnt++;
      sum = w;
      p = w;
    }
  }
  cout << cnt + 1 << "\n";
  return 0;
}
