#include <bits/stdc++.h>
using namespace std;
int N[1000001];
int main() {
  int n, k, p, q;
  scanf("%d %d", &n, &k);
  for (int i = 0; i < n; i++) {
    scanf("%d", &N[i]);
  }
  int c1 = 0, c2 = 0, c = 0;
  for (int i = 1; i < n; i++) {
    if (N[i] != N[i - 1]) {
      c1++;
    } else if (N[i] == N[i - 1]) {
      if (c1 > c) c = c1;
      c1 = 0;
    }
  }
  if (c1 > c) {
    c = c1;
  }
  cout << c + 1 << endl;
  return 0;
}
