#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a, in;
  cin >> n >> a;
  int ans = 1;
  int cont = 1;
  int ant = 0;
  for (int i = 0; i < n; i++) {
    scanf("%d", &in);
    if (i == 0) {
      ant = in;
    } else {
      if (in != ant) {
        ant = in;
        cont++;
        if (cont > ans) {
          ans = cont;
        }
      } else {
        cont = 1;
      }
    }
  }
  cout << ans << endl;
  return 0;
}
