#include <bits/stdc++.h>
using namespace std;
const int mod = 998244353;
const int INF = 1000000000;
const int N = 200005;
long long int gcd(long long int a, long long int b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
void solve() {
  long long int n, k;
  cin >> n >> k;
  vector<long long int> t(n);
  int mins = N;
  int x;
  vector<long long int> a(N);
  vector<long long int> cnt(N);
  for (int i = 0; i < (n); i++) {
    cin >> x;
    a[x]++;
    if (x < mins) {
      mins = x;
    }
  }
  for (int i = 200000; i > 0; i--) {
    cnt[i] = cnt[i + 1] + a[i];
  }
  int ans = 0;
  long long int cur = 0;
  for (int i = 200000; i > mins; i--) {
    cur = cur + cnt[i];
    if (cur + cnt[i - 1] > k) {
      ans++;
      cur = 0;
    }
  }
  if (cur > 0) {
    ans++;
  }
  cout << ans << endl;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie();
  cout.tie();
  int t = 1;
  while (t--) {
    solve();
  }
}
