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