#include <iostream>

int findLongestSequence(int* arr, int size) {
    if (size == 0) return 0;

    int maxLength = 1;
    int currentLength = 1;

    for (int i = 1; i < size; ++i) {
        if (arr[i] == arr[i - 1]) {
            currentLength++;
        } else {
            if (currentLength > maxLength) {
                maxLength = currentLength;
            }
            currentLength = 1;
        }
    }

    if (currentLength > maxLength) {
        maxLength = currentLength;
    }

    return maxLength;
}

int main() {
    int arr[] = {1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5};
    int size = sizeof(arr) / sizeof(arr[0]);

    int maxLength = findLongestSequence(arr, size);

    std::cout << "Длина самой длинной последовательности: " << maxLength << std::endl;

    return 0;
}

