#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c, d, e, f;
  d = 0;
  e = 0;
  f = 0;
  cin >> a >> c;
  for (int i = 0; i < a; i++) {
    cin >> b;
    if (d != b) {
      e = e + 1;
    } else if (d == b) {
      e = 1;
    }
    if (e > f) {
      f = e;
    }
    d = b;
  }
  cout << f << endl;
}
