#include <bits/stdc++.h>
using namespace std;
long long int gcd(long long int a, long long int b) {
  while (b > 0) {
    a %= b;
    swap(a, b);
  }
  return a;
}
long long int lcm(long long int a, long long int b) {
  return (a * b) / gcd(a, b);
}
void solve() {
  int n, k;
  cin >> n >> k;
  int a[n + 1];
  bool flag = false;
  for (int i = 0; i < n; i++) cin >> a[i];
  vector<int> v;
  a[n] = a[n - 1];
  k = 0;
  for (int i = 1; i < n + 1; i++) {
    k++;
    if (a[i] == a[i - 1]) {
      v.push_back(k);
      k = 0;
      flag = true;
      continue;
    }
  }
  sort(v.begin(), v.end());
  if (flag)
    cout << v[v.size() - 1] << "\n";
  else
    cout << n << "\n";
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  solve();
  return 0;
}
