#include <bits/stdc++.h>
using namespace std;
int n, k, a[200005 / 2], ans = -1, cnt = 0;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> n >> k;
  for (int i = 1; i <= n + 1; i++) {
    if (i < n + 1)
      cin >> a[i];
    else
      a[i] = a[i - 1];
    if (a[i] != a[i - 1])
      cnt++;
    else {
      ans = max(ans, cnt);
      cnt = 1;
    }
    ans = max(ans, cnt);
  }
  cout << ans;
}
