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;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using ll = long long int;
using vll = vector<ll>;
using vvll = vector<vll>;
using vvvll = vector<vvll>;
using vd = vector<double>;
using vvd = vector<vd>;
using vvvd = vector<vvd>;
using P = pair<int, int>;
using Pll = pair<ll, ll>;
using cdouble = complex<double>;
const double eps = 1e-9;
const double INFD = numeric_limits<double>::infinity();
const double PI = 3.14159265358979323846;
bool nearlyeq(double x, double y) { return abs(x - y) < eps; }
bool inrange(ll x, ll t) { return x >= 0 && x < t; }
bool inrange(vi xs, ll t) {
  for (auto x : xs)
    if (!(x >= 0 && x < t)) return false;
  return true;
}
int ceillog2(ll x) {
  int ret = 0;
  x--;
  while (x > 0) {
    ret++;
    x >>= 1;
  }
  return ret;
}
ll rndf(double x) { return (ll)(x + (x >= 0 ? 0.5 : -0.5)); }
ll floorsqrt(ll x) {
  ll m = (ll)sqrt((double)x);
  return m + (m * m <= x ? 0 : -1);
}
ll ceilsqrt(ll x) {
  ll m = (ll)sqrt((double)x);
  return m + (x <= m * m ? 0 : 1);
}
ll rnddiv(ll a, ll b) { return (a / b + (a % b * 2 >= b ? 1 : 0)); }
ll ceildiv(ll a, ll b) { return (a / b + (a % b == 0 ? 0 : 1)); }
ll gcd(ll m, ll n) {
  if (n == 0)
    return m;
  else
    return gcd(n, m % n);
}
ll lcm(ll m, ll n) { return m * n / gcd(m, n); }
int main() {
  int n, m;
  cin >> n >> m;
  vi a(n);
  for (int i = 0; i < (int)n; i++) cin >> a[i];
  sort(a.begin(), a.end());
  vi b(n);
  for (int i = 0; i < (int)n; i++) {
    auto itr = upper_bound(a.begin(), a.end(), a[i] + 5);
    b[i] = itr - a.begin();
  }
  vvi dp(n + 1, vi(m + 1, INT_MIN));
  dp[0][0] = 0;
  for (int i = 0; i < (int)n; i++) {
    for (int j = 0; j < (int)m + 1; j++) {
      if (dp[i][j] != INT_MIN) {
        dp[i + 1][j] = max(dp[i + 1][j], dp[i][j]);
        if (j < m) dp[b[i]][j + 1] = max(dp[b[i]][j + 1], dp[i][j] + b[i] - i);
      }
    }
  }
  if (dp[n][m] == INT_MIN)
    cout << n << endl;
  else
    cout << dp[n][m] << endl;
}