#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k = 1, i, m = 1, p;
  cin >> n >> p;
  int a[n];
  for (i = 0; i < n; i++) cin >> a[i];
  for (i = 1; i < n; i++) {
    if (a[i] != a[i - 1])
      k++;
    else {
      m = max(m, k);
      k = 1;
    }
  }
  m = max(m, k);
  cout << m << endl;
  return 0;
}
