#include #include using namespace std; int main() { int n; cin >> n; vector arr(n); // Input the array for (int i = 0; i < n; ++i) { cin >> arr[i]; } int longest = 1, current = 1; for (int i = 1; i < n; ++i) { if (arr[i] == arr[i - 1]) { current++; } else { if (current > longest) { longest = current; } current = 1; } } // Final check for the last sequence if (current > longest) { longest = current; } // Output result cout << longest << endl; }