#include <bits/stdc++.h>
using namespace std;
int a[100005];
int b[100005];
int main() {
  int n, k;
  cin >> n >> k;
  for (int i = 0; i < n; ++i) cin >> a[i];
  int cnt = 1;
  int maxx = 1;
  for (int i = 1; i < n; ++i) {
    if (a[i] != a[i - 1])
      cnt++;
    else {
      maxx = max(cnt, maxx);
      cnt = 1;
    }
    if (i == n - 1) maxx = max(cnt, maxx);
  }
  cout << maxx;
  return 0;
}
