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