#include #define mp make_pair #define PII pair #define fi first #define se second #define pb push_back #define ll long long #define ull unsigned long long #define ui unsigned int #define sci(x) scanf("%d",&x) #define scs(s) scanf("%s",s) #define scc(c) scanf("%c",c) #define scd(d) scanf("%lf",&d) #define scld(ld) scanf("%Lf",&ld) using namespace std; //******************************************** //Error tracking #define show(args...) { vector _v = split(#args, ','); err(_v.begin(), args); } vector split(const string& s, char c) { vector v; stringstream ss(s); string x; while (getline(ss, x, c)) v.emplace_back(x); return move(v); } void err(vector::iterator it) {} template void err(vector::iterator it, T a, Args... args) { cerr << it -> substr((*it)[0] == ' ', it -> length()) << " = " << a << '\n'; err(++it, args...); } //******************************************** const int NMAX = 105; int n,a[NMAX],fr[NMAX]; int main() { int i; // freopen("input","r",stdin); // freopen("output","w",stdout); cin.sync_with_stdio(false); cin >> n; for (i = 1; i <= n; i++) { cin >> a[i]; fr[a[i]]++; } int mx = 0; for (i = 0; i <= 100; i++) mx = max(mx, fr[i] + fr[i + 1]); cout << mx << "\n"; return 0; }