#include #define MAXNUM 1000 int main(void) { int n; scanf("%d", &n); int maxlen[MAXNUM] = {}; int count = 0; int prev, head; scanf("%d", &prev); for (int i = 1; i < n; i++) { scanf("%d", &head); if (head == prev) { maxlen[count]++; } else { prev = head; count++; } } int max = 1; for (int i = count; i >= 0; i--) { if (maxlen[i] + 1 > max) { max = maxlen[i] + 1; } } printf("%d", max); return 0; }