#include <bits/stdc++.h>
using namespace std;
long long int mod = 1e9 + 7;
const int nmax = 1e5 + 10;
const int inf = INT_MAX;
int arr[nmax];
int main() {
  int n, k;
  scanf("%d %d", &n, &k);
  for (int i = 0; i < n; i++) scanf("%d", &arr[i]);
  arr[n] = arr[n - 1];
  int mxcnt = 0, cnt = 1;
  for (int i = 0; i < n; i++) {
    if (arr[i] != arr[i + 1]) {
      cnt++;
    } else {
      mxcnt = max(cnt, mxcnt);
      cnt = 1;
    }
  }
  printf("%d", mxcnt);
}
