#include <bits/stdc++.h>
using namespace std;
int w[201000], n, K;
int main() {
  int i;
  scanf("%d%d", &n, &K);
  for (i = 1; i <= n; i++) {
    scanf("%d", &w[i]);
  }
  int s = 1, M = 1;
  for (i = 2; i <= n; i++) {
    if (w[i] == w[i - 1]) s = 0;
    s++;
    M = max(M, s);
  }
  printf("%d\n", M);
}
