//start of VMFP template version 1.8 #define Shubham using #define VMFP namespace #define IITBHU std //#include //tests //#include #include //pairs #include #include //#include #include //v.size() v.push_back() v.erase(v.begin()+i) v.insert(v.begin()+i, j) //#include #include //map map1 map1.size() map1.erase("value1") map::iterator it=map1.begin(); if(it!=map1.end()){cout<first<<" "<second;} while(it!=map1.end())++it; #include //set1.insert() set1.find() set1.size() set::iterator it=set1.begin(); it!=set1.end() it=set1.find(value1) set1.lower_bound(value1+1) cout<<*it< //empty() size() top() push() pop() #include // empty() size() front() back() push() pop() #include #include #include //stringstream sso #include // s is a string or vector next_permutation(s.begin(),s,end()) sort(s.begin(),s.end()) reverse(s.begin(),s.end()) #include //ifstream ifile ifile.open("filename.txt") ifile.close() ofstream ofile #include #include // sqrt(r), pow(a,b)=a^b #define large INT_MAX #define small INT_MIN #define FOR(a,b) for (int (a)=0;(a)<(b);(a)++) #define ALL(x) (x).begin(),(x).end() #define SORT(a,i,j) sort(a+i,a+j+1) // sorting from integar post i to integar post j both inclusive #define value(x) cerr << "The value of " << #x << " is " << x << endl #define value2(x,y) cerr<<"value of "<<#x<<" is "< #define vi vector #define mod 1000000007LL #define sfrom(s,i,j) s.substr(i,j-i+1) #define mp make_pair #define fi first #define se second Shubham VMFP IITBHU; string chartostring(char c){ return string(1,c); } string doubletostring(int num,int den){ stringstream sso; sso<> result; return result; } //end of VMFP template version 1.8 int main(){ //cout.precision(15); int n; cin>>n; int a[100]; FOR(i,100)a[i]=0; FOR(i,n){ int tmp; cin>>tmp; a[tmp-1]++; } int result = 0; for(int i = 0; i < 99; i++){ if(a[i]+a[i+1] > result){ result = a[i]+a[i+1]; } } cout<