#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int a[N];
int main() {
  int n, k, cnt = 1, mx = 0;
  cin >> n >> k;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  if (n == 1)
    cout << 1;
  else {
    a[n + 1] = a[n];
    for (int i = 1; i <= n; i++) {
      if (a[i] != a[i + 1]) cnt++;
      if (a[i] == a[i + 1]) {
        mx = max(mx, cnt);
        cnt = 1;
      }
    }
    cout << mx;
  }
  return 0;
}
