#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 7;
int s[N];
int h[N], n, k;
void add(int x, int y) {
  while (x <= N) {
    s[x] += y;
    x += x & -x;
  }
}
int sa(int x) {
  int ans = 0;
  while (x) {
    ans += s[x];
    x -= x & -x;
  }
  return ans;
}
int mx, mn = 9999999;
int ans;
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &h[i]);
    add(1, 1);
    add(h[i] + 1, -1);
    mx = max(mx, h[i]);
    mn = min(mn, h[i]);
  }
  int sum = 0;
  for (int i = mx; i >= mn + 1; i--) {
    int ss = sa(i);
    sum += ss;
    int sp = sa(i - 1);
    if (i == mn + 1) {
      ans++;
      break;
    }
    if (sum + sp <= k) {
      continue;
    }
    sum = 0;
    ans++;
  }
  printf("%d", ans);
}
