#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<int> vec;
  int n, k;
  cin >> n >> k;
  vec.resize(n);
  for (int i = 0; i < n; i++) {
    cin >> vec[i];
  }
  if (n == 1) {
    cout << 1 << endl;
    return 0;
  }
  int temp = 1;
  int result = 0;
  int big_end = -1;
  for (int i = 0; i < n - 1; i++) {
    if (vec[i] == vec[i + 1]) {
      big_end = i;
      result = max(result, temp);
      temp = 1;
      continue;
    }
    temp++;
  }
  if (temp > 1) {
    result = max(result, temp);
  }
  cout << result << endl;
}
