#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 15;
int n, k, mx, tmp, best, a[N], c[N], res;
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> k;
  for (int i = 0; i < n; i++) cin >> a[i];
  int c = 1;
  for (int i = 1; i < n; i++) {
    if (a[i] == a[i - 1]) best = max(best, c), c = 0;
    c++;
  }
  cout << max(best, c) << endl;
}
