//#include "/Users/priya/Desktop/competitiveProgrammingDocuments/VP/Header.h" #include //freopen ("/Users/priya/Desktop/B-small-attempt1.in","r",stdin); //freopen ("/Users/priya/Desktop/B-small-attempt1.out","w",stdout); using namespace std; #define ll long long int #define ull unsigned long long #define ul unsigned long #define ios ios::sync_with_stdio(0);cin.tie(0); #define eps 1e-4 #define PI acos(-1.0) #define printarray(a,n) for(ll i=1;i<=n;i++) cout< smallest power of n than given number /* WHERE WISHES ARE GRANTED When people bring you down, You shall rise, Never back down, Practice everyday, Till the last day.... */ ll n; ll ar[N]; int main(){ cin >> n; for(ll i = 1; i <= n; i ++) cin >> ar[i]; ll ans = 0; sort(ar + 1 , ar +n + 1); for(ll i = 1; i <= n; i ++){ ll val = ar[i]; ll temp = 0; for(ll j = i; j <= n; j ++) if(ar[j] - ar[i] <= 1) temp ++; ans = max(ans , temp); } cout << ans << endl; return 0; }