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