#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, k;
  cin >> n >> k;
  int *input = new int[n];
  for (int i = 0; i < n; i++) cin >> input[i];
  int answer = 0;
  int helper = 1;
  for (int i = 1; i < n; i++) {
    if (input[i] == input[i - 1]) {
      answer = max(answer, helper);
      helper = 1;
    } else
      helper++;
  }
  answer = max(answer, helper);
  cout << answer << endl;
}
