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