#include <bits/stdc++.h>
using namespace std;
int n, k;
int h[200010];
long long int dp[200010], temp[200010];
int main() {
  scanf("%d %d", &n, &k);
  int minn = 1e9;
  int maxx = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &h[i]);
    temp[h[i]]++;
    minn = min(minn, h[i]);
    maxx = max(maxx, h[i]);
  }
  for (int i = maxx; i >= 1; i--) {
    temp[i] = temp[i] + temp[i + 1];
    dp[i] = temp[i] + dp[i + 1];
  }
  int last = -1;
  int answer = 0;
  long long int cost = 0;
  for (int i = maxx; i > minn; i--) {
    if (dp[i] - cost > k) {
      cost = dp[i + 1];
      answer++;
      last = i + 1;
    } else if (dp[i] - cost == k) {
      cost = dp[i];
      answer++;
      last = i;
    }
  }
  if (last != minn + 1 && minn != maxx) answer++;
  printf("%d", answer);
  return 0;
}
