#include <bits/stdc++.h>
using namespace std;
int max_n = 1e5, max_k = 1e5;
int main() {
  int n, k, count = 0, clr, prev_clr = 0;
  int max_count = 0;
  cin >> n;
  cin >> k;
  for (int i = 0; i < n; i++) {
    cin >> clr;
    if (clr != prev_clr)
      count++;
    else {
      max_count = max(max_count, count);
      count = 1;
    }
    prev_clr = clr;
  }
  max_count = max(max_count, count);
  cout << max_count;
  return 0;
}
