/*Divyam Goyal - IIT-BHU*/ #include using namespace std; //freopen("input.txt","r",stdin);freopen("output.txt","w",stdout); #define trace1(x) cerr << #x << ": " << x << endl; #define trace2(x, y) cerr << #x << ": " << x << " | " << #y << ": " << y << endl; #define trace3(x, y, z) cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl; #define trace4(a, b, c, d) cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl; #define bitcount __builtin_popcountll #define sd(x) scanf("%d",&x) #define slld(x) scanf("%lld",&x) #define ss(x) scanf("%s",x) #define ll long long #define mp(a,b) make_pair(a,b) #define F first #define S second #define pb(x) push_back(x) #define MOD 1000000007 #define MAX 100005 int a[105]; int f[105]; int main() { //ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n; cin>>n; for(int i=1;i<=n;i++) { cin>>a[i]; f[a[i]]++; } int ans=0; for(int i=1;i<=98;i++) { ans=max(ans,f[i]+f[i+1]); } cout<