#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, k;
  cin >> n >> k;
  int arr[n];
  for (int i = 0; i < int(n); i++) {
    cin >> arr[i];
  }
  int mn = 1, e = 0, s = 1;
  while (s < n) {
    if (arr[s] != arr[s - 1]) {
      mn = max(mn, s - e + 1);
    } else {
      mn = max(mn, s - e);
      e = s;
    }
    s++;
  }
  cout << mn << "\n";
  return 0;
}
