#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, result;
  int a[100000], b[100000], p = 0;
  while (cin >> n >> k) {
    result = 1;
    for (int i = 0; i < n; i++) cin >> a[i];
    if (n == 1) {
      printf("1\n");
      continue;
    }
    for (int i = 1; i < n; i++) {
      if (a[i] != a[i - 1]) {
        result++;
        b[p] = result;
        p++;
      } else {
        b[p] = result;
        p++;
        result = 1;
      }
    }
    sort(b, b + p);
    cout << b[p - 1] << endl;
  }
}
