#include <bits/stdc++.h>

using namespace std;

int main()
{
   int N, K;
   cin >> N >> K;

   // if one server can handle at least N clients then we just need one server
   if (N <= K)
   {
      cout << "1" << endl;
      return 0;
   }

   priority_queue<int> servers;
   int size = 0;
   while (N--)
   {
      int t;
      cin >> t;
      while (!servers.empty() && t - (-servers.top()) >= 1000)
      {
         servers.pop();
      }
      servers.push(-t);
      size = max((int)servers.size(), size);
   }

   cout << ceil((double)size / K) << endl;

   return 0;
}