//The best is yet to come... #include #include using namespace std; #define ll long long int #define inf 1000000000000 #define mod 1000000007 #define pb push_back #define mp make_pair #define all(v) v.begin(),v.end() #define S second #define F first #define boost1 ios::sync_with_stdio(false); #define boost2 cin.tie(0); #define mem(a,val) memset(a,val,sizeof a) #define endl "\n" #define maxn 100001 ll a[maxn]; int main() { boost1;boost2; int i,j,n,f=0,x,y,ans=0; char ch; string s; cin>>n; for(i=1;i<=n;i++) cin>>a[i]; sort(a+1,a+n+1); for(i=1;i<=n;i++) { for(j=i;j<=n;j++) { if(a[j]-a[i]<=1) ans=max(ans,j-i+1); } } cout<