#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, i, x1, x2, out = 0, temp = 0;
  cin >> n >> k;
  cin >> x1;
  for (i = 1; i < n; i++) {
    cin >> x2;
    if (i == (n - 1) && (x1 != x2)) {
      out = max(i - temp + 1, out);
    } else if (x1 == x2) {
      out = max(i - temp, out);
      temp = i;
    }
    x1 = x2;
  }
  out = max(i - temp, out);
  cout << out;
  return 0;
}
