#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e5 + 1;
int plot[MAX], n, k;
void input() {
  cin >> n >> k;
  for (int i = 1; i <= n; i++) scanf("%d", &plot[i]);
}
int main() {
  input();
  int res = 0, k1 = 0, k2 = 0;
  for (int i = 1; i <= n; i++) {
    if (plot[i] != k1) k2++;
    if (plot[i] == k1) res = max(res, k2), k2 = 1;
    k1 = plot[i];
  }
  res = max(res, k2);
  cout << res;
}
