#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 7;
const int MAX_HEIGHT = 2 * 1e5 + 7;
int n, k;
int min_height = INF;
int answer = 0;
vector<int> tower;
vector<int> heights;
void read() {
  cin >> n >> k;
  tower.resize(n + 1, 0);
  heights.resize(MAX_HEIGHT, 0);
  for (int i = 0; i < n; i++) cin >> tower[i];
}
int main() {
  read();
  for (int i = 0; i < n; i++) heights[tower[i]]++;
  for (int i = 0; i < n; i++) min_height = min(min_height, tower[i]);
  int current_sum = 0;
  int current_count = 0;
  for (int i = MAX_HEIGHT - 1; i >= 0; i--) {
    int tempi = heights[i];
    heights[i] += current_count;
    current_count += tempi;
  }
  for (int i = MAX_HEIGHT - 1; i > min_height; i--) {
    if (heights[i] + current_sum < k)
      current_sum += heights[i];
    else if (heights[i] + current_sum == k) {
      answer++;
      current_sum = 0;
    } else if (heights[i] + current_sum > k) {
      answer++;
      current_sum = 0;
      if (heights[i] < k)
        current_sum += heights[i];
      else
        answer++;
    }
  }
  if (current_sum > 0) answer++;
  cout << answer;
}
