Problem: You are a coach at your local university. There are n students under your supervision, the programming skill of the i-th student is a_i.

You have to create a team for a new programming competition. As you know, the more students some team has the more probable its victory is! So you have to create a team with the maximum number of students. But you also know that a team should be balanced. It means that the programming skill of each pair of students in a created team should differ by no more than 5.

Your task is to report the maximum possible number of students in a balanced team.

Input

The first line of the input contains one integer n (1 ≤ n ≤ 2 ⋅ 10^5) — the number of students.

The second line of the input contains n integers a_1, a_2, ..., a_n (1 ≤ a_i ≤ 10^9), where a_i is a programming skill of the i-th student.

Output

Print one integer — the maximum possible number of students in a balanced team.

Examples

Input


6
1 10 17 12 15 2


Output


3


Input


10
1337 1337 1337 1337 1337 1337 1337 1337 1337 1337


Output


10


Input


6
1 1000 10000 10 100 1000000000


Output


1

Note

In the first example you can create a team with skills [12, 17, 15].

In the second example you can take all students in a team because their programming skills are equal.

In the third example you can create a team consisting of a single student (and you cannot create a team consisting of at least two students).

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
inline unsigned long long int GCD(unsigned long long int a,
                                  unsigned long long int b) {
  while (b != 0) {
    unsigned long long int t = a % b;
    a = b;
    b = t;
  }
  return a;
}
inline unsigned long long int LCM(unsigned long long int a,
                                  unsigned long long int b) {
  return a * b / GCD(a, b);
}
int n, k, ans = 1;
int dp[5005][5005];
int arr[5005];
int cntOfIndex[5005];
vector<int> finArr;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  ;
  cin >> n >> k;
  for (int(i) = 0; (i) < int(n); (i)++) {
    cin >> arr[i];
  }
  sort(arr, arr + n);
  for (int p = 0; p < n; p++) {
    int i = arr[p];
    if (finArr.empty() || finArr.back() != i) {
      finArr.push_back(i);
      cntOfIndex[finArr.size() - 1] = 1;
    } else {
      cntOfIndex[finArr.size() - 1]++;
    }
  }
  n = finArr.size();
  k = min(n, k);
  for (int j = 1; j <= k; j++) {
    dp[0][j] = cntOfIndex[0];
  }
  ans = cntOfIndex[0];
  for (int i = 1; i < n; i++) {
    for (int j = 1; j <= k; j++) {
      dp[i][j] = max(dp[i - 1][j], dp[i - 1][j - 1] + cntOfIndex[i]);
      int minBoundIndex;
      for (minBoundIndex = i;; minBoundIndex--) {
        if (minBoundIndex == 0 || finArr[i] - finArr[minBoundIndex - 1] > 5)
          break;
      }
      if (minBoundIndex < i) {
        int cntSum = 0;
        for (int k = minBoundIndex; k <= i; k++) {
          cntSum += cntOfIndex[k];
        }
        if (minBoundIndex > 0) {
          dp[i][j] = max(dp[i][j], dp[minBoundIndex - 1][j - 1] + cntSum);
        } else {
          dp[i][j] = max(dp[i][j], cntSum);
        }
      }
      ans = max(dp[i][j], ans);
    }
  }
  cout << ans;
}