#include <bits/stdc++.h>
using namespace std;
ifstream fin("input.txt");
ofstream fout("output.txt");
class algoritm {
  friend istream &operator>>(istream &, algoritm &);

 public:
  void rezolvare() {
    int maxx = 1;
    int nr = 1;
    for (int j = 0; j < n - 1; j++) {
      if (v[j] != v[j + 1]) {
        nr++;
      } else {
        nr = 1;
      }
      maxx = max(maxx, nr);
    }
    cout << maxx;
  }

 protected:
  int n, a;
  vector<int> v;
};
ostream &operator<<(ostream &output, algoritm &alg) { return output; }
istream &operator>>(istream &input, algoritm &alg) {
  input >> alg.n >> alg.a;
  for (int i = 1; i <= alg.n; i++) {
    int x;
    input >> x;
    alg.v.push_back(x);
  }
  return input;
}
template <typename T>
T conversie(T b) {
  T x;
  int nr = 0;
  x = b;
  while (x) {
    nr += x % 10;
    x /= 10;
  }
  return nr;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  algoritm alg;
  cin >> alg;
  alg.rezolvare();
}
