#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n, k;
  int N[100000];
  scanf("%d %d", &n, &k);
  for (int i = 0; i < n; i++) {
    scanf("%d", &N[i]);
  }
  int length = 1;
  int max = 0;
  bool sign = 1;
  for (int i = 0; i < n; i++) {
    if (N[i] != N[i + 1]) {
      if (i + 1 < n) {
        length++;
      }
    } else {
      if (length > max) {
        max = length;
      }
      sign = 0;
      length = 1;
    }
  }
  if (max < length) {
    max = length;
  }
  if (sign) {
    printf("%d\n", length);
  } else {
    printf("%d\n", max);
  }
}
