#include <bits/stdc++.h>
using namespace std;
long long n, k, a[100002], tmp, mx;
signed main() {
  ios_base::sync_with_stdio(0);
  cin >> n >> k;
  for (long long i = 1; i <= n; i++) cin >> a[i];
  a[n + 1] = a[n];
  for (long long i = 1; i <= n + 1; i++) {
    if (a[i] != a[i - 1])
      tmp++;
    else {
      mx = max(mx, tmp);
      tmp = 1;
    }
  }
  cout << mx;
}
