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