#include <bits/stdc++.h>
using namespace std;
int n, k, ans, t;
int a[100005];
int main() {
  scanf("%d%d", &n, &k);
  ans = 1;
  t = 1;
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &a[i]);
    if (a[i] == a[i - 1]) {
      ans = max(ans, i - t);
      t = i;
    }
  }
  ans = max(ans, n - t + 1);
  printf("%d\n", ans);
  return 0;
}
