#include <bits/stdc++.h>
using namespace std;
const int maxn = 200000;
int arr[maxn + 5];
int main() {
  int n, k, m, ans = 0, maxh = 0, use1 = 0, use2 = 0, minh = 1e9 + 5;
  scanf("%d %d", &n, &k);
  for (int i = 0; i < n; i++) {
    scanf("%d", &m);
    arr[m]++;
    maxh = max(maxh, m);
    minh = min(minh, m);
  }
  for (int i = maxh; i > minh;) {
    ans++;
    while (use1 + arr[i] + use2 <= k) {
      use2 += arr[i--];
      use1 += use2;
    }
    use1 = 0;
  }
  printf("%d\n", ans);
  return 0;
}
