#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, K;
  int min = 100001;
  vector<int> minpos;
  minpos.push_back(1);
  vector<int> A(100001);
  cin >> N >> K;
  for (int a = 1; a <= N; a++) {
    cin >> A.at(a);
    if (A.at(a) < min) {
      min = A.at(a);
    }
  }
  for (int a = 1; a <= N; a++) {
    if (A.at(a) == min && a != 1 && a != N) {
      minpos.push_back(a);
    }
  }
  minpos.push_back(N);
  int sum = 0, i = 0;
  while (i < minpos.size() - 1) {
    if ((minpos.at(i + 1) - minpos.at(i) + 1) == K) {
      sum += (minpos.at(i + 1) - minpos.at(i) + 1) / K;
    } else {
      sum += (minpos.at(i + 1) - minpos.at(i) + 1) / K + 1;
    }
    i++;
  }
  while (i < minpos.size() - 2) {
    if ((minpos.at(i + 1) - minpos.at(i) + 1) % (K - 1) +
            (minpos.at(i + 2) - minpos.at(i + 1) + 1) % (K - 1) ==
        K - 1) {
      sum--;
    }
    i++;
  }
  cout << sum << endl;
}
