#include <bits/stdc++.h>
using namespace std;
long long a[100005], mx;
void solve() {
  long long n, k, cnt = 0;
  cin >> n >> k;
  for (long long i = 1; i < n + 1; i++) {
    cin >> a[i];
    if (a[i] != a[i - 1])
      cnt++;
    else {
      mx = max(cnt, mx);
      cnt = 1;
    }
  }
  mx = max(cnt, mx);
  cout << mx;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
