#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long n, k;
  cin >> n >> k;
  long long arr[n];
  for (long long i = 0; i < n; i++) cin >> arr[i];
  sort(arr, arr + n);
  long long ff[200001] = {0};
  ff[arr[0]] = n;
  for (long long i = 1; i < n; i++) {
    if (arr[i] != arr[i - 1]) ff[arr[i]] = n - i;
  }
  long long h = arr[n - 1];
  for (long long i = h; i > arr[0]; i--)
    if (ff[i] == 0) ff[i] = ff[i + 1];
  long long sum = 0, ans = 0;
  for (long long i = h; i > arr[0]; i--) {
    if (sum + ff[i] <= k)
      sum += ff[i];
    else {
      sum = 0;
      sum = ff[i];
      ans++;
    }
  }
  if (sum != 0) ans++;
  cout << ans;
}
