#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e6 + 10, INF = 1e9 + 10, mod = 1e9 + 7;
const double eps = 1e-9;
inline int read() {
  char c = getchar();
  int x = 0, f = 1;
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar();
  return x * f;
}
int N, K;
int a[MAXN], mxx[MAXN];
int comp(const int &a, const int &b) { return a > b; }
int main() {
  N = read();
  K = read();
  int mn = INF, mx = 0;
  for (int i = 1; i <= N; i++) a[i] = read(), mn = min(a[i], mn);
  sort(a + 1, a + N + 1, comp);
  for (int i = 1; i <= N; i++) a[i] -= mn, mx = max(a[i], mx);
  for (int i = 1; i <= N; i++) mxx[a[i]]++;
  int res = 0, ans = 0, num = 0;
  for (int i = mx; i >= 1; i--) {
    num += mxx[i];
    res += num;
    if (res > K) ans++, res = num;
  }
  cout << ans + (res != 0);
  return 0;
}
