#include using namespace std; #define pb push_back #define mp make_pair typedef long long ll; typedef pair pii; int n; int cnt[100]; int main() { #ifdef LOCAL freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); #endif ios_base::sync_with_stdio(false); cin.tie(0); cin >> n; for (int i = 0, a; i < n; ++i) { cin >> a; ++cnt[a]; } int res = 0; for (int i = 0; i < 99; ++i) { res = max(res, cnt[i] + cnt[i + 1]); } cout << res << endl; return 0; }