#include <bits/stdc++.h>
using namespace std;
int N = 2e5;
long long i, j, x, y, z, m, n, k, l, r, f, b, t, x2, y2, dp[300020], x3, y3, p,
    z2, d[200000], a[200010], ma;
long long ans;
string s, s1;
vector<int> v, v3;
int main() {
  cin >> n >> m;
  for (i = 1; i <= n; i++) {
    cin >> x;
    a[x]++;
  }
  for (i = N; i >= 1; i--) {
    ans += a[i];
    if (ans == n) {
      if (p > 0) t++;
      cout << t;
      return 0;
    }
    if (p + ans > m) t++, p = 0;
    p += ans;
  }
  cout << t;
}
