#include using namespace std; typedef unsigned short usint; typedef unsigned uint; typedef long lint; typedef short sint; typedef unsigned long ulint; typedef unsigned long long ullint; typedef long long llint; #define INF 1000000 #define mp make_pair #define pii pair #define pll pair #define pui pair #define pul pair #define pull pair // inline funkcije int main() { ios_base::sync_with_stdio(0); int n; cin >> n; int A[n]; int X[101]; memset(X, 0, sizeof X); for (int t1 = 0; t1 < n; ++t1) { cin >> A[t1]; X[A[t1]]++; } int maxc = 0, c = 0; for (int t1 = 1; t1 < n; ++t1) { maxc = max(maxc, X[t1]+X[t1-1]); } cout << maxc << '\n'; return 0; }