#include #include #include #include #include using namespace std; int main() { int n; cin >> n; int a[n], count[100]; for(int i = 0; i<100; i++){ count[i] = 0; } for(int i = 0; i> a[i]; count[a[i]]++; } int res = 0; for(int i = 0; i<99; i++){ if(count[i]+count[i+1]>res){ res = count[i]+count[i+1]; } } cout << res << endl; /* Enter your code here. Read input from STDIN. Print output to STDOUT */ return 0; }