#include <bits/stdc++.h>
int main() {
  long int no_houses, no_colors, i, count = 1, final = 1;
  scanf("%ld %d ", &no_houses, &no_colors);
  long int arr_colors[no_houses];
  for (i = 0; i < no_houses; i++) {
    scanf("%ld", &arr_colors[i]);
  }
  for (i = 0; i < no_houses - 1; i++) {
    if (arr_colors[i] != arr_colors[i + 1])
      count += 1;
    else
      count = 1;
    if (final < count) final = count;
  }
  printf("%ld", final);
  return 0;
}
