#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 5;
int main() {
  int n, k;
  cin >> n >> k;
  vector<int> v;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    v.push_back(x);
  }
  int maxi = 1;
  int cnt = 1;
  for (int i = 0; i < n - 1; i++) {
    if (v[i] != v[i + 1])
      cnt++;
    else {
      if (maxi < cnt) maxi = cnt;
      cnt = 1;
    }
  }
  if (cnt > maxi)
    cout << cnt;
  else
    cout << maxi;
}
