#include <bits/stdc++.h>
using namespace std;
const int N = 2 * 1e5 + 10;
long long res = 1, mx;
long long a[N];
void solve() {
  long long n, k;
  cin >> n >> k;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  for (int i = 1; i < n; ++i) {
    if (a[i] == a[i - 1]) {
      mx = max(res, mx);
      res = 1;
    } else {
      res++;
    }
  }
  mx = max(res, mx);
  cout << mx;
}
int main(int argc, char const *argv[]) {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
