#include #include #include #include using namespace std; int main() { size_t n; cin >> n; vector arr(n); size_t i; for (unsigned short i = 0; i < n; ++i)cin >> arr[i]; mapmymap; for (i = 0; i < n; ++i) { mymap[arr[i]]++; } size_t best(0), thissum; map::iterator itr=mymap.begin(); while(next(itr)!=mymap.end()) { thissum = itr->second; if (itr->first - (next(itr))->first == -1) thissum += next(itr)->second; if (thissum > best)best = thissum; ++itr; } if (itr->second > best)cout<second<