/****************************************** * AUTHOR: BHUVNESH JAIN * * INSTITUITION: BITS PILANI, PILANI * ******************************************/ #include using namespace std; typedef long long LL; typedef long double LD; int f[101]; int main() { #ifndef ONLINE_JUDGE // freopen("inp.txt", "r", stdin); #endif int n, a; scanf("%d", &n); for(int i = 1; i <= n; ++i) { scanf("%d", &a); f[a] += 1; } int ans = f[1]; for(int i = 2; i < 101; ++i) { ans = max(ans, f[i] + f[i-1]); } printf("%d\n", ans); return 0; }