#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  vector<int> A(n);
  for (int i = 0; i < n; i++) {
    cin >> A[i];
  }
  A.push_back(A.back());
  n++;
  int l = 0, r = 0, M = 1;
  for (r = 1; r < n; r++) {
    if (A[r - 1] == A[r]) {
      M = max(r - l, M);
      l = r;
    }
  }
  cout << M;
  return 0;
}
